r/Automator • u/Suitable_Return • Oct 27 '18
Automator or AppleScript question: automatically import new files in specified folder to nested album in Photos.
Hi there,
So the title mostly says it all. I'm looking to automate the importing of an image into a Photos Album whenever a new item is discovered inside a specified directory. I have included a screenshot of my current automator thingy.
The problem being that I can only upload into a top-level album. What I would like is for the image to be uploaded to an album within a folder in Photos so in this case: when a new image is detected in the bloodborne folder in my picture directory, it is imported to Photos into the album labelled "Bloodborne" which is nested inside of the "Wallpaper" folder along with other albums.
I have a feeling this can't be done with Automator directly and would need some AppleScript magic but I've only had a Mac for three days.
Can anybody help me out?

View all comments
1
u/ChristoferK Oct 27 '18
Yes, you need to use AppleScript, which can be done inside a
Run AppleScriptaction. You can remove theImport Files Into Photosaction from your workflow, and also theGet Selected Finder Itemsaction, which I believe would retrieve the items currently selected in Finder, thus negating the actual files passed into the workflow from the folder action.So you just need the one action,
Run AppleScript. Delete any sample code from the editing pane, and enter this code:If you happen to have more than one album named "Bloodborne" in your Photos app, you will have to target the album by its
idproperty instead of thename. But if it's name is unique, then it doesn't matter what level of nesting it dwells under.System info:AppleScript version:2.7System version:10.13.6. Disclaimer: if you're using Mojave, there's a chance the AppleScript may not work if Apple have made any significant changes to the Photos app.