How to export folder of multiple albums from Photos keeping original file

Hi everyone,


I recently downloaded this script from here:

Export Albums to Folders - Jacques Rioux's Script


set dest to "/Users/HOME/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" 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
end makeFolder


And it works as it's intended too. Thank you Jacques.


One thing I would like to do is to export the "original files" with it's original creation date and original file size.


It appears currently when I run this script with Photos 3.0 it creates the images with today's date and new file size.


Here's an example:


User uploaded file


Could someone provide some help on adjusting the script to export the original files instead?


Another question, if possible: can I export the file names to be the same name as the album name?


Many thanks,

MacBook Pro with Retina display, macOS High Sierra (10.13.6)

Posted on Oct 17, 2018 9:04 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 19, 2018 2:30 AM

Two changes:

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

    Change HOME to your short user name

  • export (get media items of albumtName) to (tFolder as alias) without using originals

    export (get media items of albumtName) to (tFolder as alias) with using originals


The export statement will export the original: Filename, creation date, modification date, and size — provided the original has not changed since its addition to the Photos library.


The export statement requires a list of media items, of which name is just a single element. Thus, you have no means during the export process to change the original filename to anything else than its original name.

Similar questions

2 replies
Question marked as Top-ranking reply

Oct 19, 2018 2:30 AM in response to propertyinvestory

Two changes:

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

    Change HOME to your short user name

  • export (get media items of albumtName) to (tFolder as alias) without using originals

    export (get media items of albumtName) to (tFolder as alias) with using originals


The export statement will export the original: Filename, creation date, modification date, and size — provided the original has not changed since its addition to the Photos library.


The export statement requires a list of media items, of which name is just a single element. Thus, you have no means during the export process to change the original filename to anything else than its original name.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to export folder of multiple albums from Photos keeping original file

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