0

this is my first attempt to run a shell script, namely 'exiftool', from applescript:

    set cmd to "exiftool -" & tag & "='" & myName & "' " & myFile
    do shell script cmd

cmd looks like this:exiftool -Artist='myName' myFile.jpg and works perfectly when directly inserted in Terminal. exiftool was installed by the standard installer!

What did i miss?

pawi
  • 101

1 Answers1

1

Run

which exiftool

or

type exiftool

and use that path instead of exiftool in the script.

For e.g. if I was using git in Automator, I'd do this.

/usr/bin/git pull 

Modify this for exiftool usage.

anki
  • 11,753
  • Great! '/usr/local/bin/exiftool' did the job.Could you shortly explain why the location is different? – pawi May 04 '20 at 10:14
  • This is due to the fact that Applescript use the standard Mac PATH to find applications. On the other hand, Terminal is using the PATH you can modify through ~/.profile (for example with a bash shell). – dan May 04 '20 at 10:26
  • @dan that edit was not correct. I showed an usage of git command since I don't know about exiftool. https://git-scm.com/docs/git-pull – anki May 04 '20 at 10:53
  • @pawi the duplicate answer & dan's comment explain that. – anki May 04 '20 at 10:54