Use Hazel to add scanned photos to an album in Apple Photos

I am trying to use Hazel to add scanned photos to an album in Apple Photos - but my solution only works when only adding one file at a time.

I have made a shortcut basically after this recipe:

- Get contents of folder X
- Repeat with each item in Contents of Folder
  - Save Repeat item to Album Y
- End Repeat

This works fine if I Add files “manually” but if I add the shortcut to a Hazel rule, and add more than one file to the folder then Hazel runs the action once for each file, so the files get added to Photos multiple times (5 files added => all 5 files added 5 times)

What am I missing here? And I am not sure if I am missing it in Hazel or Shortcuts

Best Regards

Karl Erik Jessen
Farum Denmark

As you note, Hazel triggers for every file, and your shortcut runs against the whole folder. You effectively have two components linked together in a way they were not intended to, so you need to modify them so they do.

Here are a couple of options:

Option 1: change your shortcut to process just the file Hazel passes to it.

Option 2: have tour shortcut filter by and set some attribute, or move/rename the file, such that it only processes each file once. So the Shortcut may be called multiple times, but not process any file.

Option 1 is the most efficient, but option 2 may be more flexible if you intend to reuse your shortcut in other processes outside of Hazel.

Hope that helps.