Embedded Applescript permission to update title of photo?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I'm trying to update the title of any media imported into Apple Photos to be a certain text string (which includes data that i can use to find the media item later). The AppleScript i wrote works in Script Editor. But it doesn't work when run via Hazel. No errors, just doesn’t actually update the title. Any idea why?

tell application "Photos"
launch
set foundItems to (media items whose filename is the name of theFile)
if the number of items in foundItems is greater than 0 then
set firstItem to the first item in foundItems
set the name of firstItem to the name of theFile
end if
end tell

I've used just the name of theFIle for now (but it will be a more unique string in practice)
lnjustin
 
Posts: 10
Joined: Sun Dec 23, 2018 3:43 pm

You might want to have the script print out values at various points in the script. You can use "display dialog" for this.
Mr_Noodle
Site Admin
 
Posts: 8358
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support