Skip to content

Instantly share code, notes, and snippets.

@raul
Created April 18, 2009 18:56
Show Gist options
  • Select an option

  • Save raul/97733 to your computer and use it in GitHub Desktop.

Select an option

Save raul/97733 to your computer and use it in GitHub Desktop.
-- AppleScript doesn't load shell's environment variables
-- in "do shell script", so here goes a nasty workaround
on shell_cmd(command)
do shell script "source ~/.profile; " & command
end shell_cmd
do shell script "echo $EDITOR" -- => ""
shell_cmd("echo $EDITOR") -- => "mate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment