For anyone who is interested, here is an AppleScript that can be used in a Service for quick metadata.
http://www.johneday.com/219/exiftool-service-for-quick-metadata-access
on run {input, parameters}
-- creates a metadata folder in the Documents folder to store results
set thePath to POSIX path of (path to documents folder) & "metadata"
do shell script "mkdir -p " & quoted form of POSIX path of thePath
tell application "Finder"
repeat with anItem in input
set theLocation to POSIX path of (anItem as text)
set {name:fileName, name extension:nameExtension} to anItem
set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
set destLocation to quoted form of (thePath & "/" & baseName & ".txt")
do shell script "exiftool -a " & quoted form of theLocation & " >" & destLocation
do shell script "open " & destLocation
end repeat
end tell
end run
Thanks, but I think you can simplify your script and run ExifTool just once for all input files by using -w OUTDIR/%f.txt instead of redirecting the output from separate commands.
- Phil
Hi Phil,
Thanks for the quick reply, and for the great tool.
Does this look better?
on run {input, parameters}
-- creates a metadata folder in the Documents folder to store results
set thePath to POSIX path of (path to documents folder) & "metadata" & "/"
do shell script "mkdir -p " & quoted form of POSIX path of thePath
set {inputFiles, outputFiles} to {{}, {}}
repeat with anItem in input
set end of inputFiles to quoted form of POSIX path of (anItem as text)
tell application "Finder" to set {name:fileName, name extension:nameExtension} to anItem
set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
set end of outputFiles to quoted form of (thePath & baseName & ".txt")
end repeat
set {TID, text item delimiters} to {text item delimiters, space}
set {inputFiles, outputFiles} to {(inputFiles as text), (outputFiles as text)}
set text item delimiters to TID
do shell script "exiftool -a " & inputFiles & " -w " & quoted form of (thePath & "%f.txt" as text) & "; open " & outputFiles
end run
Yes, better. This should run faster since it only calls exiftool once, although the script doesn't become as simple as I had hoped since you still have to loop through the input items to quote the input file names and generate the output files for your "open" command.
- Phil