Turn CSS into Stylus

You've apparently missed the fact that KM establishes a brand new Terminal environment when it runs, and it does not use any of the preferences established for Terminal.app – no .profile – no nothing.

This is also true of AppleScript.

There are ways to load your environment, but I don't remember off the top of my head.

If you run:

echo $PATH

From a Keyboard Maestro Execute a Shell Script action – to a text window you'll see it does not compare to what you got from the Terminal app.

Breaking up your path I find there is one duplicate:

/bin:
/opt/X11/bin:
/sbin:
/Users/Fake/.rvm/bin:
/Users/Fake/.rvm/gems/ruby-2.0.0-p195@global/bin:
/Users/Fake/.rvm/gems/ruby-2.0.0-p195/bin:
/Users/Fake/.rvm/rubies/ruby-2.0.0-p195/bin:
/usr/bin:
/usr/local/bin:
/usr/local/bin: <-- DUPLICATE •••••
/usr/local/git/bin
/usr/sbin:

I would try running the above path command in KM and then use it to mimic the path you got from the Terminal.

Remember to subtract out what you get from echo $PATH and then add in the above items WITHOUT any duplicates.

You should end up with something close to this:

export PATH=/usr/local/bin:/usr/local/git/bin/opt/X11/bin:/Users/Fake/.rvm/bin:/Users/Fake/.rvm/gems/ruby-2.0.0-p195@global/bin:/Users/Fake/.rvm/gems/ruby-2.0.0-p195/bin:/Users/Fake/.rvm/rubies/ruby-2.0.0-p195/bin:$PATH;

Remember that the $PATH on the end will add the existing path to the pieces you are adding.

Once you've created this full path for KM then you can try your macro again.

-Chris