Apple Script query

Discussion in 'Mac Programming' started by philstone, Apr 1, 2011.

  1. philstone macrumors 6502

    Joined:
    Oct 13, 2008
    Location:
    Jersey, Channel Isles
    #1
    Hi All,


    I have a few terminal commands that I want to package up into an app - nothing fancy or clever, just to change permissions on a .sh file then execute it..
    I've read that Apple Script editor will let me do this then save as an app - is this right?

    I've so far got (taking into account the .sh will be on the desktop)

    tell application "Terminal"
    do script with command "cd /Users/<username>/Desktop; ./install.sh
    end tell

    In terminal I'd normally do chmod +x on the file first... (using Sudo) - how can I add that into the app?

    My next question will be how can I make this an all in one .app so that the install.sh file lives inside the package?

    Thanks!
    Phil
     
  2. sero macrumors member

    Joined:
    Aug 28, 2008
    #2
    Code:
    #!/bin/bash
    sh ~/Desktop/install.sh
    exit 1
    save it was whatever.command, and make that file executable. Should work I believe...

    No idea what you're after with putting the install script "inside the package"
     

Share This Page