ExifTool Forum

ExifTool => Developers => Topic started by: deathrobot on February 14, 2015, 03:03:11 PM

Title: Run ExifTool in Automator service
Post by: deathrobot on February 14, 2015, 03:03:11 PM
Hi. I'm trying to create an automator service to display exif data for a file. I've experimented with permutations of:

* * * * *
Service receives selected image file in Finder

Shell (pass input as arguments)
for f in "$@"
do
   data="$(exiftool -m "$f")"
   /usr/local/bin/growlnotify "$data"
done

Show Growl notification
* * * * *

I've obviously got this wrong. Would love to know how to make this work.

Thanks,
Michael
Title: Re: Run ExifTool in Automator service
Post by: deathrobot on February 14, 2015, 04:15:02 PM
Getting closer here (and now this is really an automator question).

run shell script: exiftool "$@"

shows all the exif data. Now I just need to display that data with something like:

osascript -e  'tell app "System Events" to display dialog "$@"'

This doesn't display the exif data, just a "$@".
Title: Re: Run ExifTool in Automator service
Post by: deathrobot on February 14, 2015, 04:43:50 PM
Solved it (in case this helps anyone). Really just needed datetimeoriginal so...

In Automator:
run shell script:
exiftool -p '$datetimeoriginal' "$@"
Display in large type (Launchbar)*

*Instead of using Launchbar, you could do:
Set value of variable
Display notification (insert the variable)
Title: Re: Run ExifTool in Automator service
Post by: Phil Harvey on February 14, 2015, 06:17:04 PM
I'm glad you figured this out because I couldn't have helped here.

- Phil

P.S. I have moved this into the developers board because I think it is more appropriate there.
Title: Re: Run ExifTool in Automator service
Post by: deathrobot on February 15, 2015, 12:06:03 PM
Thanks, Phil. Another tweak you can do is to adjust the shell script so that the date is in the format you like, in my case:

exiftool -p '$datetimeoriginal' -d %Y-%m-%d' '%H.%M.%S "$@"

and if you're using Launchbar, it shows the data in a nice window overlay, where you can use command-c to copy it. It's now ready to paste into the file name.

AND, you can assign a keyboard shortcut to the service to make the whole process really fast.

1) select file
2) Run service keyboard shortcut
3) If there is exif data for datetimeoriginal, it shows in a launchbar window
4) Command-c
5) Hit return, and then paste into the file name
Title: Re: Run ExifTool in Automator service
Post by: justmike on August 15, 2016, 04:40:54 PM
Deathrobot, This seems to be a very useful tool. Could it be modified to run on a schedule, say, every 24 hours, and then write the changes to a text file?