-
-
Save natcl/7a5c98aae8b21475caf9 to your computer and use it in GitHub Desktop.
property imageFiles : {"jpg", "pef", "dng", "jpeg"} | |
on adding folder items to theWatchedFolder after receiving theDetectedItems | |
repeat with theItem in theDetectedItems | |
set theItemPath to POSIX path of theItem | |
set ImageFile to POSIX file theItemPath | |
tell application "System Events" | |
if name extension of theItem is in imageFiles then | |
tell application "Photos" | |
set DestinationAlbumName to "Inbox" | |
if not (exists container named DestinationAlbumName) then | |
make new album named DestinationAlbumName | |
end if | |
import ImageFile into container named DestinationAlbumName with skip check duplicates | |
end tell | |
tell application "Finder" | |
delete theItem | |
end tell | |
end if | |
end tell | |
end repeat | |
end adding folder items to |
thanks for looking into it!
I don't seem to have a Library folder in the path you directed that I put the script - /Users/your_username/Library/Workflows/Applications/Folder Actions/
If I try to create a folder called Library, it says one already exists, but I can't see it using Finder. Any suggestions?
The Library folder is a 'hidden file', so you will need to change your settings to show hidden files and folders. You can search for how to do that. It's a little obtuse :)
FYI
My PC did not have a folder called ~/Library/Workflows, because I have never launch Automator app. After launching it, I could see ~/Library/Workflows/Applications/Folder Actions.
Will this import images as referenced images if you have the option unchecked in Preferences. I made an automator script similar to that and it seems to import the pictures within the Photos library... Thanks !
I tried to use this script to import Camera uploads (dropbox) but Photos reports that an import is already started, is there a way that the import only starts after the folder content is unchanged for x seconds?
I checked and I don't think shared albums are available to AppleScript sadly...