Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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

Dec 25, 2016 11:48 PM in response to josepvr

Hello!


finally I've finished exporting all my albums without any issue.


Let me paste my source code that is simillar to original one adding jhcallihan modifications (of course I can not guarantee that will work for everybody, please analyze it before launching):


set dest to "/Volumes/Multimedia/Fotos/" as POSIX file as text -- the destination folder (use a valid path) 

tell application "Photos" to set MyList to name of albums
end

BubbleSort(MyList)

with timeout of 0 seconds
  tell application "Photos"
  activate
  set l to MyList

  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) with using originals
  end repeat
  end if
  end tell
end timeout

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

on BubbleSort(MyList)
  if class of MyList is list then
  set theSize to length of MyList
  repeat with i from 1 to theSize
  repeat with j from 2 to (theSize - i + 1)
  if ((item (j - 1) of MyList) > (item j of MyList)) then
  set temp to (item (j - 1) of MyList)
  set (item (j - 1) of MyList) to (item j of MyList)
  set (item j of MyList) to temp
  end if
  end repeat
  end repeat
  return MyList
  else
  return false
  end if
end BubbleSort

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.