I have written long ago an Applescript script that exports pictures selected in Apple Photos app with various basic options, such as adding borders, adjusting size, tuning for Web publishing, etc, and the addition of metadata copyright info using an exiftool command thru a shell script. But I cannot figure how to preserve the original files metadata in the exported images, and this turns out to become a critical need now in my current activities. I am considering locating the original file in the "Masters" Photo Library folder, extracting and saving the metadata with an exiftool command, and applying the same metadata to the exported files, but the simple task of obtaining the POSIX path of the original file proves to be challenging (I am 72 years old) and the other tasks challenging as well. Anyone here with better ideas ?

1 Answer 1


I have finally found a solution. There is one export command option:

export CurrentSelection using originals yes to (pTargetFolderPath as alias)

that permits to export the original pictures from Photos (there may be more than one exported files in the temp directory, sometimes a RAW file in addition to JPG or others. This needs to be addressed in the script. I am exporting originals in a temporary directory, and exporting edited pictures into another directory called target, and using the exiftool command adjusted with the suitable POSIX path of the files:

exiftool -tagsFromFile oririnalfile editedfile.jpg

able to transfer the metadata from the original file to the edited one. The sequence of my applescripts handlers is as follows:

my MakeTempFolderAsNeeded(pTempFoldername)
my MakeFolderAsNeeded(pTargetFoldername)
my export_selected_original(pTempFolderPath)
set PathOne to my getPosixPathofFile(pTempFolderPath)
my export_selected_images(pTargetFolderPath)
set PathTwo to my getPosixPathofFile(pTargetFolderPath)
my CopyMetadata(PathOne, PathTwo)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .