Adding 'shutdown' button to dock

Discussion in 'Mac Programming' started by tombarnes, Sep 7, 2009.

  1. tombarnes macrumors 6502

    tombarnes

    Joined:
    Feb 26, 2006
    Location:
    Cornwall, United Kingdom
    #1
    Hi all,

    I, for some reason, would like to add a shutdown and sleep button to my dock, preferably over next to the trash can.

    I have looked at automator and can't see anything that would let me do this. So, I am turing to you guys. Anyone done it? Anyone know how? I can't see from my google searches that anyone has done this.

    Any thoughts?

    -Tom
     
  2. Rhalliwell1 macrumors 6502a

    Joined:
    May 22, 2008
    #2
    I dont know how but i know if you do ctrl+alt+cmd+eject it will shut your system down :)
     
  3. tombarnes thread starter macrumors 6502

    tombarnes

    Joined:
    Feb 26, 2006
    Location:
    Cornwall, United Kingdom
    #4
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    Applescript might be easier? This page has some commands to restart and shutdown:
    http://www.tuaw.com/2007/12/29/applescript-finder-commands/

    You would need the developer tools, i think (install from your OS X DVD). You can then save the single line scripts and stick them in your dock.

    -Lee
     
  5. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #6
    AppleScript does the trick.

    Code:
    tell application "Finder"
    	shut down
    end tell
    You have to save it as an app, however, which means that it must remain to the left of the white line.

    mt
     

Share This Page