Running an External Script?

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

Moderator: Mr_Noodle

Running an External Script? Wed Aug 03, 2016 7:23 pm • by sirkako
Hi -

I'm trying to literally run this shell script:
(pardon my n00bness to scripting if I misuse any terms)

exiftool '-filemodifydate<createdate' "$1"

In order to copy the CreateDate of a photo to the FileModifyDate, so Hazel will name the file correctly with the date from the metadata. Apparently in El Capitan OS X exiftool scripts are stored in /usr/local/bin/exiftool, so I'm trying to implement something like:

/usr/local/bin/exiftool "-filemodifydate<createdate" DIR

Which work on Termial, but I'm not sure how to do it on Hazel. I'm trying:

Shell: /usr/local/bin/
-
exiftool '-filemodifydate<createdate' "$1"

But it's not working (for some obvious reason to someone knowledgeable).

What would be the right way, please?

Also, does the $1 still carries the file in an external script?

TIA.

Rick.
sirkako
 
Posts: 4
Joined: Sun Aug 30, 2015 2:10 pm

Re: Running an External Script? Thu Aug 04, 2016 11:43 am • by Mr_Noodle
You do not want to set the shell to /usr/local/bin. If in doubt, leave it blank. Instead just use the full path to exiftool as you have it in the second example you posted.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Running an External Script? Thu Aug 04, 2016 2:34 pm • by sirkako
Mr_Noodle wrote:You do not want to set the shell to /usr/local/bin. If in doubt, leave it blank. Instead just use the full path to exiftool as you have it in the second example you posted.


Thank you. Will try that! :D
sirkako
 
Posts: 4
Joined: Sun Aug 30, 2015 2:10 pm


Return to Support