Create Mac OS X AppleScript application to call Unix/terminal commands

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.

7 Responses to “Create Mac OS X AppleScript application to call Unix/terminal commands”

  1. clay Says:

    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!

  2. A Collection of 250+ Terminal Commands, Hacks, Tips and Tuts for Mac OS X Says:

    [...] Create Mac OS X AppleScript application to call Unix/terminal commands [...]

  3. Gary Says:

    Thanks for the help.
    As clay says: How simple!
    Yep, thanks a million for posting this from me too.

  4. Shahar Says:

    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”

  5. OOOOO Says:

    Thank you!!! This is awesome!

  6. ee Says:

    thanks!

  7. Bseagull Says:

    Works…kinda… it will open terminal like I want it to and says it works but then it won’t… help?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.