AppleScript and C-shell Script

Discussion in 'Mac Apps and Mac App Store' started by youmacsoiammac, Apr 15, 2004.

  1. youmacsoiammac macrumors newbie

    Joined:
    Apr 15, 2004
    Location:
    London, UK
    #1
    Hi all

    First of all, I am new to mac, still haven't received my ibook G4, don't know what happen to all the UK suppliers, no stores are in stock.

    Seconally, just wondering how much different between AppleScript and C-shell Script? Is it similiar to C-shell on Sun's CDE(Common Desktop Environment)?

    Anyway, that's all the question for now, may have somemore once I recived my mac.

    Xu
     
  2. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #2
    AppleScript is about as far from csh script as Pascal is from C, as you can see from these examples.

    This one uses the Internet Connect application to dial out:

    Code:
    tell application "Internet Connect"
    	activate
    	connect
    	quit
    end tell
    

    This one uses System functionality to do its work:

    Code:
    repeat with volumeLevel from 7 to 0 by -1
    	set volume volumeLevel
    end repeat
    repeat with volumeLevel from 0 to 7 by 1
    	set volume volumeLevel
    end repeat
    

    These execute UNIX commands, one visibly and the other invisibly:

    Code:
    tell application "Terminal"
    	activate
    	do script "cd fahproc1; ./fah.sh"
    	do script "cd fahproc2; ./fah.sh"
    end tell
    

    Code:
    do shell script "drutil tray eject"
    
     
  3. youmacsoiammac thread starter macrumors newbie

    Joined:
    Apr 15, 2004
    Location:
    London, UK

Share This Page