Page 1 of 1

Possibly stupid question regarding Shell script vars

PostPosted: Sat Nov 08, 2014 10:33 pm
by melorama
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.

Re: Possibly stupid question regarding Shell script vars

PostPosted: Mon Nov 10, 2014 3:55 pm
by Mr_Noodle
You can't do it from shell scripts at the moment. That feature is only available to AppleScript and JavaScript.

Re: Possibly stupid question regarding Shell script vars

PostPosted: Thu Nov 27, 2014 1:11 pm
by jaharmi
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.