That is an idea.
I experimented a bit, and with Apple Script we could make it a bit simpler, directly in Photos: This will save the installation of exiftool and the necessity to export the files. This way the lossless workflow will be preserved.
Create an Automator action, that executes an Apple Script to change the titles to the filename, if the title is empty:
The Apple Script:
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
Launch Automator, create a new service, and drag a "Run Apple Script" action into the workflow.
Copy and paste the text above into the "Run Apple Script" action to replace the default text in the action.
Save this workflow with a suitable name. It will be installed in the services.
- Now launch Photos and select a few test images.
- Open the "Photos Menu > Services".
- The service should be shown in the menu - I saved my version as "filename2title".
- Select the service to let it run. When you click the selected photos again, the titles should change.
After the Automator action completed: