Page 1 of 1

Embedded Applescript permission to update title of photo?

PostPosted: Sun Sep 29, 2019 3:19 pm
by lnjustin
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)

Re: Embedded Applescript permission to update title of photo

PostPosted: Mon Sep 30, 2019 11:10 am
by Mr_Noodle
You might want to have the script print out values at various points in the script. You can use "display dialog" for this.