Applescript question?

Discussion in 'Mac Apps and Mac App Store' started by anubis, Feb 27, 2005.

  1. anubis macrumors 6502a

    Joined:
    Feb 7, 2003
    #1
    How do I write an applescript to simply shut down the system?

    I have an ATI Remote Wonder and want the power button on the remote to completely shut down my Mac. I can set up the remote software to launch any document or application when I press the power button on the remote. I want it to run an applescript that will execute the "shutdown -h now" command. Should be pretty simple (one to three liner), but i'm an applescript novice.

    Help?
     
  2. HexMonkey Administrator

    HexMonkey

    Staff Member

    Joined:
    Feb 5, 2004
    Location:
    New Zealand
    #2
    You can use the "do shell script" command to run a shell command, for example:
    Code:
    do shell script "shutdown -h now"
    Alternatively, you could use:
    Code:
    tell application "System Events" to shut down
     

Share This Page