Skip to content

Instantly share code, notes, and snippets.

@jswright61
Created September 19, 2024 09:30
Show Gist options
  • Select an option

  • Save jswright61/d02cf0d375a76e8990c55cb8442c0750 to your computer and use it in GitHub Desktop.

Select an option

Save jswright61/d02cf0d375a76e8990c55cb8442c0750 to your computer and use it in GitHub Desktop.
Applescript to get the filenames of the currently selected Photos in Apple Photos
tell application "Photos"
activate
set thePhotosFiles to {}
set imageSel to (get selection) -- get the selected image
repeat with im in imageSel
set thePhotosFiles to the ({filename of im} & thePhotosFiles)
end repeat
set AppleScript's text item delimiters to return
--set AppleScript's text item delimiters to ","
set theDelimitedPhotosFiles to thePhotosFiles as string
set AppleScript's text item delimiters to ""
set the clipboard to theDelimitedPhotosFiles
return theDelimitedPhotosFiles
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment