News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

[macOS] Tag image files containing any gps data

Started by magikct, April 04, 2019, 08:03:40 AM

Previous topic - Next topic

magikct

Hi,
I'm looking for solution that allows me to tag (for example, the red tag) in Finder files that contain any GPS data. Can anyone help me?
I would like it to work like this:
Find first image file in current folder (JPEG, TIFF or RAW) -> check if file contains GPS data -> if no -> find second image -> check if it contains GPS data -> if yes -> tag secondimage.jpg -a 'Red' -> find third file ...

Thanks in advance!

Phil Harvey

#1
How about something like this?:

exiftool -MDItemFSLabel=6 -if '$gpslatitude' DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

magikct

YES! It's working!
but in the above was a typo (should be '-' before 'if').
Thank you!
Can I assign my own tag name from the finder, e.g. 'GPSdataHERE'?

Phil Harvey

Quote from: magikct on April 04, 2019, 08:30:05 AM
in the above was a typo (should be '-' before 'if').

Thanks.  I've fixed this mistake.

QuoteCan I assign my own tag name from the finder, e.g. 'GPSdataHERE'?

See the MacOS tags documentation for a list of available Finder tags.  Only a few are writable, but these should give you what you want.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

magikct

Phil, I can assign any tag I want.
See an example:

MacBook:folder user$ tag example.jpg -a 'GPSdataHERE'
MacBook:folder user$

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

magikct

#6
But how can I combine both commands?

EDIT:

It's working now that I want.
exiftool -MDItemUserTags=GPSdataHERE -if '$gpslatitude' .


Thanks a lot for quick response and help!

Phil Harvey

Did you look at the MacOS tag documentation that I linked?
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


magikct

Phil I have another question:
How to append tag "GPSdataHERE" to existing file tags instead of replace all tags with one "GPSdataHERE" ?

StarGeek

Use += instead of just =

exiftool -MDItemUserTags+=GPSdataHERE -if '$gpslatitude' .
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

magikct