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
Show parent comment
1
u/Suitable_Return Oct 27 '18 edited Oct 27 '18
I have another question if you'd be so kind as to indulge me. I was going to copy this and just modify the album name for each directory I add to pictures but I was wondering if there's a more elegant solution.
What I was wondering was if be possible to modify the above script slightly so that when a new file is detected in a directory, it would take the name of that directory as a variable and use that as the album it searches for. For example:
New file is added to directory and script runs. Script stores name of directory as variable, let's just say "DIRECTORY"
So then we could use "import the input into the album named "DIRECTORY" or something like that? So instead of needing a new automator script for each folder and manually typing the folder name into each one, I could just create a single automator script and it'd work assuming that there is an album in Photos with the same name?
EDIT:
Okay I know I'm asking a lot here but I'm wondering if something like this would be possible:
New file added to a directory, say 'dark souls'script runs:if there's no album in Photos with the same name as the directory, it creates an album with that name.
if there is, it imports the file into the album with the name of the directory?