I have thousands of photos all viewed via Photos.app > Smart Albums. The ‘albums’ are set up using words in the Title and pics are sorted within each Smart Folder by Title. There’s far too many Smart Folders to edit these parameters.
For years, I have used an Applescript to batch adopt imported photo Filenames as their Titles.
macOS 13 Ventura has broken my system because Apple has decided that to display the Filename in grey is enough, but this doesn’t work for me.
Running the script now achieves nothing. Typing titles in is too time consuming, and it doesn’t appear to be possible to manually copy the filename (from within Photos) and paste it into the Title field …not that I want to do that either! Large numbers of my earlier photos have Titles that differ from their Filenames.
I can create a Smart Folder of new photos based on Filename, but ‘Sort by Title’, perhaps obviously, doesn’t work with greyed out Filenames. And the existing Smart Folders that are set up to display both older and newer photos are ‘sorting’ older photos by Title, but placing the newer photos at the top, ie: in Date order (…out-of-date order!).
Another frustration is that my Filenames are longer than Photos displays. Photos does not allow me to click on a grey filename and run the cursor along, because the click activates the blank Title field and hides the Filename.
I have registered all of this with Apple as a bug, weeks ago – without a result, so far.
This is the script…
(Code posting backticks added by NG. See the Markdown Guide here.)
on run {input, parameters}
tell application "Photos"
activate
set imageSel to (get selection)
if imageSel is {} then
error "Please select an image."
else
repeat with im in imageSel
set title to the name of im
if not (exists (title)) then
set the name of im to the filename of im
end if
end repeat
end if
end tell
return input
end run
Is there anything I can do to it, to make it work?