To do this, load up the AppleScript editor and enter the following:
do shell script "..."
Replacing … with the command that you wish to run.
If the command requires administrator privileges then append the command with ‘with administrator privileges’ and then any subsequent commands with ‘and password’. For example:
do shell script "..." with administrator privileges
do shell script "..." and password
do shell script "..." and password
When the script is complete and tested save it as an ‘Application’ and tick the ‘Run-only’ checkbox.
January 30, 2007 at 9:38 pm |
I am new to using applescript and couldn’t figure out how to run a command in terminal to launch Opera into Kioskmode, but this did it! How simple! Thanks a million for posting this!
November 11, 2009 at 10:42 pm |
[...] Create Mac OS X AppleScript application to call Unix/terminal commands [...]
December 14, 2009 at 10:17 am |
Thanks for the help.
As clay says: How simple!
Yep, thanks a million for posting this from me too.
December 16, 2009 at 1:08 pm |
How do I do this for a unix command I have included in the Application Bundle?
I want it to work nomatter where the app is saved so the path to the unix command should be relative to the package itself.
Say – TheAppName.app/Contents/TheUnixCommand”
April 29, 2010 at 4:00 pm |
Thank you!!! This is awesome!
August 31, 2011 at 3:51 pm |
thanks!
October 1, 2011 at 10:12 pm |
Works…kinda… it will open terminal like I want it to and says it works but then it won’t… help?