ExifTool Forum

ExifTool => Newbies => Topic started by: mcquiff on October 17, 2013, 10:23:05 AM

Title: Get file path of file with specific tag field
Post by: mcquiff on October 17, 2013, 10:23:05 AM
I'm trying to work out how to get the path of  files names in folder whose "source" tag is equal to 'AIR'

I'm running it on a mac.

Hope you can help

Matt
Title: Can I simplify the result
Post by: mcquiff on October 17, 2013, 10:42:31 AM
I'm doing this at the moment

exiftool -if '$source =~ /AIR/i' -none -r ~/Pictures/CompletedFolders/Freedom_wk10_PSD/
and the result is

======== /Users/StudioA/Pictures/CompletedFolders/Freedom_wk10_PSD/FR10NW12084MU7RH.psd
    1 directories scanned
   39 files failed condition
    1 image files read

I'm only interested in the file paths (ideally without the string of ='s before.

Can this be achieved?

Matt
Title: Re: Get file path of file with specific tag field
Post by: Phil Harvey on October 17, 2013, 11:08:11 AM
Hi Matt,

You could try this:

exiftool -p '$directory/$filename' -if '$source eq "AIR"' -r DIR

where DIR is the name of the root directory to scan.

- Phil
Title: Re: Get file path of file with specific tag field
Post by: mcquiff on October 17, 2013, 11:24:00 AM
That helps, although you still get the number of files scanned etc, but i think its workable for me now, many thanks!!
Title: Re: Get file path of file with specific tag field
Post by: Phil Harvey on October 17, 2013, 11:24:42 AM
Add -q to avoid the summary messages.

- Phil
Title: Re: Get file path of file with specific tag field
Post by: mcquiff on October 17, 2013, 11:32:50 AM
Excellent!! Thank you!
Title: Re: Get file path of file with specific tag field
Post by: mcquiff on February 21, 2014, 05:45:06 AM
Slightly changing this as I am doing something similar to this, If I want only the summery result more specifically the last line and first number

1 image files read

so have a result of 1 how can I extract just this? Or should I do this in applescript

set S_B_Edit to first word of last paragraph of (do shell script "exiftool -if '$captionwriter =~ /Editted_by_StudioB/i' -none -r ~/Pictures/CompletedFolders/")
Title: Re: Get file path of file with specific tag field
Post by: Phil Harvey on February 21, 2014, 07:18:31 AM
This is one for AppleScript.

- Phil