🌱 Import folders to Photos for mac

Source

I use the following AppleScript to import folders into albums. It only does one folder at a time but even so that’s a lot easier than doing it by hand in Photos. Because folders with large numbers of images can be slow to process in Photos and sometimes the script will timeout waiting for Photos to finish. With one folder this is not a problem as it will still have been imported completely.

(*
    Imports a folder of images into Photos into an album named after the folder.
    Whether the images are copied or aliased depends upon your Photos preferences.
    No error checking!!
*)

tell application "Finder"
    activate
    choose folder with prompt "Please choose a folder to import into Photos as an album:"
    set theFolderToImport to the result
    set theFoldersName to the name of theFolderToImport
    set thePhotosToImport to the files of theFolderToImport
    set thePhotosToImportAsAliases to {}
    repeat with b in thePhotosToImport
        set a to b as alias
        set the end of thePhotosToImportAsAliases to a
    end repeat
end tell

tell application "Photos"
    activate
    delay 2
    set theNewAlbum to make new album named theFoldersName
    import thePhotosToImportAsAliases into theNewAlbum with skip check duplicates
end tell
Made by Brandon . If you find this project useful you can donate.