Currently Being Moderated

Export Albums to Folders - Jacques Rioux's Script

The following script by Jacques Rioux will export selected albums as folders (with the same name as the albums) to a folder on your Desktop named PHOTOS-Albums. With his permissions I'm publishing it here.  It was discussed in this ASC topic: export same albums from Photos.

 

Open Script Editor and paste the following into its window:

setdestto "/Users/HOME/Desktop/PHOTOS-Albums/" asPOSIX fileastext-- the destination folder (use a valid path)

tell application "Photos"

                     activate

      set l to name of albums

      set albNames to choose from list l with prompt "Select some albums" with multiple selections allowed

 

      if albNames is not false then -- not cancelled 

                                    repeat with tName in albNames

                                                set tFolder to dest & tName

         my makeFolder(tFolder) -- create a folder named (the name of this album) in dest  

         export (get media items of album tName) to (tFolder as alias) without using originals

                                    end repeat

                     end if

end tell

on makeFolder(tPath)

                     do shell script "mkdir -p " & quoted form of POSIX path of tPath

endmakeFolder

 

Change "HOME" to your short login user name or what your Home folder is named.   You can also change the entire location to wherever you'd like, i.e. the Documents folder or an external hard drive.

 

Here's how to apply the script:

 

1 - launch the script, in the next window select the albums you want to export and click on the OK button:

A2P.png

 

2 - on the Desktop a folder named PHOTOS-Albums will be created

Finder001.jpg

and inside will be folders representing the albums you selected to export.

Finder002.jpg

 

NOTE 1: The exported files include edited versions if edited and all metadata, i.e. keywords, titles, descriptions and locations. 


NOTE 2: the script has been compiled and saved as an application which can be downloaded from this tutorial page: P01 - Applescripts from Photos’ User Tips Compiled as Applications.

 

You will need to open the application with Script Editor and change "HOME" to your short login user name or what your Home folder is named.

OTsig.png

Replies

Delete User Tip

Are you sure you want to delete this user tip?