Get file path of file with specific tag field

Started by mcquiff, October 17, 2013, 10:23:05 AM

Previous topic - Next topic

mcquiff

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

mcquiff

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

Phil Harvey

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
...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 ($).

mcquiff

That helps, although you still get the number of files scanned etc, but i think its workable for me now, many thanks!!

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 ($).

mcquiff


mcquiff

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/")

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 ($).