I modified the flow a bit, but my biggest problem is that the Shell environment I can access from the Terminal app is different from the one I can access via KM or AppleScript for that matter. The environment variables are not the same to start with:
In Terminal, ‘echo $PATH’ gives me the following answer:
Which covers the ImageMagick software I need for my macro.
If I do the same from within KM with a Execute Shell Script step, I get the following path:
/usr/bin:/bin:/usr/sbin:/sbin
Has this something to do with SIP and such in El Capitan? Is there a way around this? Because I think this is the reason my macro doesn’t work. It cannot execute the convert command, but it does that fine in a Terminal window…
The Execute a Shell Script action executes script in non-interactive mode (see the INVOCATION section of the bash man page). As such none of your profile scripts (like ~/.profile) will be executed. This means that custom environment variable settings will not be applied, in particular any settings for your PATH environment variable, and any settings for tool-specific environment variables like PERL5LIB). You can set these by creating a variable with “ENV_” at the start (eg ENV_PATH or ENV_PERL5LIB) and settings its value appropriately.
If the intention is just to show how the particular question you asked was resolved, post the macro as a reply within the topic.
If the macro is likely to be useful (or instructive) to basically anyone else, then post it as a new topic in the macro category.
I would be very happy to see a significant uptick in the number of macros posted and I hope personally to start going through my macros at posting the useful or instructive ones.