ExifTool Forum

ExifTool => Newbies => Topic started by: magikct on April 04, 2019, 08:03:40 AM

Title: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 08:03:40 AM
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!
Title: Re: [macOS] Tag image files containing any gps data
Post by: Phil Harvey on April 04, 2019, 08:16:06 AM
How about something like this?:

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

- Phil
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 08:30:05 AM
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'?
Title: Re: [macOS] Tag image files containing any gps data
Post by: Phil Harvey on April 04, 2019, 08:33:14 AM
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 (https://exiftool.org/TagNames/MacOS.html) for a list of available Finder tags.  Only a few are writable, but these should give you what you want.

- Phil
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 08:38:47 AM
Phil, I can assign any tag I want.
See an example:

MacBook:folder user$ tag example.jpg -a 'GPSdataHERE'
MacBook:folder user$
Title: Re: [macOS] Tag image files containing any gps data
Post by: Phil Harvey on April 04, 2019, 08:42:42 AM
Yes.
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 08:54:36 AM
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!
Title: Re: [macOS] Tag image files containing any gps data
Post by: Phil Harvey on April 04, 2019, 09:09:56 AM
Did you look at the MacOS tag documentation that I linked?
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 09:10:37 AM
Yes. thanks!
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 05:17:03 PM
Phil I have another question:
How to append tag "GPSdataHERE" to existing file tags instead of replace all tags with one "GPSdataHERE" ?
Title: Re: [macOS] Tag image files containing any gps data
Post by: StarGeek on April 04, 2019, 05:34:40 PM
Use += instead of just =

exiftool -MDItemUserTags+=GPSdataHERE -if '$gpslatitude' .
Title: Re: [macOS] Tag image files containing any gps data
Post by: magikct on April 04, 2019, 06:45:07 PM
Great! Thanks guys. My life is better now.