Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

export same albums from Photos

Hi


How can I export my library or part of my library from Photos with same album structure created?


For example, I have in Photos albums A, B, C, D, E etc


I want to export the pictures in a folders structure in OSX/finder as albums in Photos

So, in

-folder A with pictures in album A

- Folder B with pictures in album B


And so on


Thanks

Posted on May 11, 2015 7:18 AM

Reply
63 replies

Sep 10, 2017 7:15 PM in response to Jacques Rioux

For those who may have had problems running the script when using this code as posted on Export Albums to Folders - Jacques Rioux's Script - Please note that there is a typo! If you copied and pasted from the page I linked, the very last line does not have a space between "end" and "make folder." Make sure there is a space there, or it will not function properly.


Thanks!

May 14, 2017 12:57 PM in response to Jacques Rioux

Hi,


I trying to use your script and I keep getting this error message. I am running the latest OSX.


Apple Event Timed out:

Photos got an error: AppleEvent Times out. (-1712)


When I run the script; it just creates the folder and after some time it gives error.

Please let me know.


If possible I would like to skip the albums in error instead of completely stopping the process.


Thanks.

Aug 3, 2017 2:10 AM in response to Jacques Rioux

Good morning all,

I was very pleased to find this tip from Jacques because I wanted to do exactly what this script promises. We are now a little further down the road (time-wise) and running Sierra on the iMac. The script ran right from the start smoothly UNTIL:


error "Photos got an error: AppleEvent timed out." number -1712


In fact most of the albums have been exported in full, but a couple not at all.

Could it be that there has to be something like "with timeout of 600 seconds" somewhere in there? I saw this in a different forum, but I have no idea where to put it.


I would be grateful for any help.

Alan

May 11, 2015 7:24 AM in response to isra_BCN

You can export the Moments structure as subfolders, but not the album structure.

To export each album to a separate folder you would have to export each album separately to a separate folder and name the folder on your own.


If you export selected photos using File > Export, you can create subfolders for each Moment, but not for the albums.

May 15, 2015 1:14 AM in response to léonie

Thanks,


Bad news, In Iphoto i used an app "iphoto to jalbum" to do that. I see in Photos it is not yet included, for me a big lack which I really don't understand why it is not included.


It is not feasible to do it one by one with big volume of albums as I normally have each end of year.


So I will need to wait to some external application to cover this functionality


Regards

Dec 7, 2015 3:24 AM in response to isra_BCN

I'm trying to workout something similar - in that I'm trying to split up my massive photos library (300Gb) into a separate file for each year - so that I can archive some of the photos to an external drive and regain some space on my macbook. I can easily export the moments for a particular year and create a new new library, but I would like to retain the albums that were based on those same photos. My albums are also structured in years and months so it would be easy to do if photos supported it - but I haven't found a way to do it. Any thoughts?


Or is it possible with applescript or automator?


Thanks,

Cam

Dec 7, 2015 8:41 AM in response to isra_BCN

Hello,



it's possible on El Capitan:


Important: the smart albums will be included in the albums, it's not possible to exclude it.

You can use this AppleScript:


set dest to "/Users/me/Desktop/photos-Albums/" as POSIX file as text -- the destination folder (use a valid path)

tell application "Photos"
    repeat with i in albums
        set tFolder to dest & (get name of i)
        my makeFolder(tFolder) -- create a folder named (the name of this album) in dest
        export (get media items of i) to (tFolder as alias) without using originals
    end repeat
end tell

on makeFolder(tPath)
    do shell script "mkdir -p " & quoted form of POSIX path of tPath
end makeFolder


Open the "Script Editor" application in /Applications/Utilities/

Copy the AppleScript and paste into the window of the "Script Editor".

Change the path of your folder in the first line of the script (use drag/drop to get the correct path of your folder).


if you want the originals, use this --> export (get media items of i) to (tFolder as alias) with using originals

Dec 7, 2015 3:19 PM in response to Jacques Rioux

Thanks Jacques,


I tried this script, but I got the following error:

error "Photos got an error: Can’t get every album." number -1728 from every album


I simplified the script to see if I could narrow down the problem:

tell application "Photos"

repeat with i in albums


display dialog ("Album: " & (get name of i))

end repeat

end tell

But this still had the same problem.

Any thoughts?

Cheers,

Cam

Feb 12, 2016 8:29 AM in response to GreLo

Hi,


GreLo wrote:


Your script is almost doing what I am exactly searching for. But: is it possible to export just the selected albums?


There is no AppleScript's command to get the selected albums.


Workaround, the "choose from list" command to select some names:


set dest to "/Users/myUserName/Desktop/photos-Albums/" as POSIX file as text -- 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"
    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
end makeFolder



Caveat : this script may not work correctly on albums with the same name (if you select a name that is not unique).

export same albums from Photos

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.