Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Loa

macrumors 68000
Original poster
May 5, 2003
1,716
74
Québec
Hello,

Is there a way to easily replace the title of an image in Photos with it's filename? Seems pointless to import images and *not* do this automatically...

Thanks
 
Last edited:

Jared G.K.

macrumors member
Jul 23, 2023
63
70
I don't think this is possible. Maybe with scripting but this is beyond my capabilities.
May I ask why you want to do that? I'm really interested because I'm struggling with some of the quirks of the photos app too. But this never was an issue for me, as the title field usually is empty, and the file name shows under each image as long as there is no title.
 
  • Like
Reactions: Loa

Loa

macrumors 68000
Original poster
May 5, 2003
1,716
74
Québec
I'd really like to use the filename to sort in photos. Sometimes date works, but many of the files I deal with have had there metadata stripped and so when they're saved in PS, their dates become the current date.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
5,245
3,726
Might try setting it before importing into Photos. Seem to recall that Photos stores lots of things in a database these days, so makes it trickier to do things automagically in there.

So... exiftool might be an option. For all jpg files in a folder:

Code:
for img in `ls -1 *.jpg`
do
exiftool -ImageDescription="$img" -P "$img"
exiftool "-Description<ImageDescription" -P "$img"
done
 
  • Like
Reactions: Loa

Loa

macrumors 68000
Original poster
May 5, 2003
1,716
74
Québec
Yeah. When I can control how they are before I import, it's fine using Photos. But I have a bunch of old images that have no meta/exif data and while their filename are a good ordering method in finder, it doesn't work in Photos.
 

bogdanw

macrumors 601
Mar 10, 2009
4,479
2,096
  • Like
Reactions: RhetTbull and Loa

Loa

macrumors 68000
Original poster
May 5, 2003
1,716
74
Québec
Yep! That script worked! Thanks!

P.S. For the people who will find this thread in the future, the automator type needed isn't service anymore, but Quick Action. Everything else works the same.
 

RhetTbull

macrumors member
Apr 18, 2022
50
38
Los Angeles, CA
@Loa looks like you solved this with AppleScripts. I'm posting an alternative solution here for others that may come across this. I'm the author of the free open source tool, osxphotos which includes a batch-edit command that can easily do this. For example, you could run the following:
Bash:
osxphotos batch-edit --title "{original_name} {title}"
which will replace the title of any currently selected photos in Photos to the filename (minus extension) + any existing title. If you wanted the full filename with extension, you'd use
Bash:
osxphotos batch-edit --title "{photo.original_filename} {title}"
and if you wanted to overwrite any existing title instead of appending it, you'd use:
Bash:
osxphotos batch-edit --title "{original_name}"

This tool has a very flexible template system and can also adjust keywords, description (caption), and location.
 
  • Like
Reactions: Loa
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.