Possibly stupid question regarding Shell script vars

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Sorry if this is a stupid question, but I've been scouring the Hazel help files and Google, but I can't seem to figure out how to use the output value(s) from a Hazel-triggered shell script as replacement "tokens" in a downstream rule action.

For example, I want to use ExifTool to extract a few image metadata values from each photo that I copy into a folder that the Hazel rule is watching, then use the extracted values from the shell script to rename the file based on that information.

I know I can just rename the file from within the shell script, but I like the simplicity of using the "renaming pattern" placeholder elements in the Hazel UI. It would be cool if I could just refer to the shell script variables, much like how Keyboard Maestro allows you to assign and use returned shell script values to an internal KM variable for use in other macro actions.
melorama
 
Posts: 7
Joined: Tue May 05, 2009 10:25 pm

You can't do it from shell scripts at the moment. That feature is only available to AppleScript and JavaScript.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

If the values you want are part of the Spotlight metadata for the image file, maybe you could use that. I see items like that under the "other" token in the renaming patterns.
jaharmi
 
Posts: 3
Joined: Sun Oct 26, 2014 1:48 pm


Return to Support