Spotlight searchable EXIF keywords

If i try to do Spotlight search for “test”, it don’t find this image file at all.

How i need to change this code so that Spotlight can see text in pictures saved by exiftool? I don’t want to use Finder Comments.

set my_comment to "test"
do shell script "exiftool -Keywords+=" & my_comment & " -overwrite_original_in_place -P " & quoted form of POSIX path of (path_here as Unicode text)

If Spotlight doesn’t use EXIF metadata, then you’d either have to write a script that transmits the EXIF metadata to Spotlight yourself, or find an mdimporter that does! :slight_smile:

It seems to me that Spotlight doesn’t support EXIF at all, but maybe there are solutions out there if you google.

A bit off topic but here is a service I wrote to access metadata quickly with ExifTool.


I can’t find any way to do this. It don’t need to be EXIF, anything goes except Finder comments.


What could have been done was to first write a Spotlight query, getting the correct image type files, and then try to search for the EXIF information.

It so happens that I don’t use EXIF, so this better be done by someone who feels the call. (adayzdone? :slight_smile: (I might help on the mdfind part). ).

I think it would be a tremendously useful thing, for those wanting this information.


I saved one picture from webpage in Safari to Downloads-folder. Now if i open Get Info window in Finder, it shows all this information under More Info:

Title, Dimension, Color space, Color profile, Description, Alpha channel and Last opened

And if i do Spotlight search for title or some words in description, then Spotlight finds this picture.

I can see in image editor software that this information is saved using ExifTool 8.18 and Title is “Object Name” and Description is “Caption-Abstract” in ExifTool.

So it looks like it is possible to use ExifTool to save text to picture files and find text using Spotlight.

But how?

Look here, and think do shell script! :slight_smile:

exiftool Application Documentation


I can’t get this to work at all. I tried to search “Object Name” and “Caption-Abstract” etc in ExifTool help page but didn’t find it. I think “title” is wrong one:

do shell script "exiftool -overwrite_original_in_place -title='mytesttitle' '/Users/cirno/Desktop/tst.png'"

See if this one works:

exiftool -comment-= -comment='new comment' a.jpg

After you have mended it to point to an image of yours. I do surmise you know how to use mdls (man mdls) to see if you get any metainformation stored.

If the one above doesn’t work, just start from the top of the ‘writing examples’ section in the manual, and inspect the result of the operation with mdls.

Whatever tool you used, It may have its own mdi-tag format, you can try to say to exiftool, that it should write metadata in that format to the file. (Or investigate if it is possible, it is possible at least to write meta-data in photo-shop format).

Good Luck! :slight_smile: