Quick Mac OS X shut-down icon

6,845

Solution 1

Open AppleScript Editor.

Paste in the following code:

tell application "Finder" to shut down

AppleScript Editor

Click File » Save, save it to the Desktop, selecting File Format: Application.

If you've saved it as the correct format, the icon should look like this:

Applescript Application

Solution 2

If you're just looking for a very quick and convenient way to shut down, hit the power button on any MacBook, or Ctrl-Eject on any desktop keyboard, then hit Return or Enter to accept the default (Shut down).

Share:
6,845

Related videos on Youtube

studiohack
Author by

studiohack

Updated on September 17, 2022

Comments

  • studiohack
    studiohack over 1 year

    How would I create an icon on my Mac OS X desktop, to do a "shut down"? (With... or without... the "are you sure" verification.)

  • Ching Chang Chung
    Ching Chang Chung almost 14 years
    I was just typing this answer - I do this all the time.
  • Josh K
    Josh K almost 14 years
    For an even faster "shut down" hold down Command (Apple) + Control when pressing the power button. This technically isn't a shutdown though and is more a hard power loss.
  • Admin
    Admin almost 14 years
    How are all those long,"impossible to remember" steps... the same as "create a desktop alias" that you just click?
  • Wisaroot K.
    Wisaroot K. almost 14 years
    I'll try that tomorrow. (But I have no idea where the "AppleScript Editor" is located...or how to run it.) Can I also turn on/off the "are you sure" part of shut-down?
  • warrenkopp
    warrenkopp almost 14 years
    you can press command(apple) + Space to open a spotlight search in the upper right corner, then type "AppleScript Editor" to search for it. Or find it in Applications/Utilities
  • ghoppe
    ghoppe almost 14 years
    @Margret Hitting control+eject is long and impossible to remember?
  • Wisaroot K.
    Wisaroot K. almost 14 years
    Ok... I "almost" got it work. When I double-click on my icon... it now opens the Editor EVERY time... and I have to find/hit "RUN" EVERY time. Am I close? What would I need to do to make it "just run immediately"? (I really need a step-by-step list of how to do this. I have 17 years of Windows experience. But 0 on my Mac. This is exactly why.)
  • ghoppe
    ghoppe almost 14 years
    You forgot to set the File Format to "Application" when you saved the script. There's a popup at the bottom of the Save dialog. Open it in AppleScript Editor and save it again.
  • Admin
    Admin almost 14 years
    Remembering "control"... remembering "eject" (that makes no sense at all)... then return... or enter... then shut-down. I need ONE step: Click the icon marked shut-down: Done. Instantly. Looks like ghoppe's idea is (by far) the best.
  • ghoppe
    ghoppe almost 14 years
    I've tested this myself, when I double-click the saved applescript application the computer quits open applications and shuts down without further notification. I don't know what you mean by hitting QUIT and RUN, or what is asking you to "quit my current session". Are you an administrative user? Are you using OS X 10.6 Snow Leopard or something else? What other applications are running? When it asks you to quit your current session, what does it say on your menu bar beside the Apple Menu? (ie. what application is asking you that?)
  • ghoppe
    ghoppe almost 14 years
    One final question… when you manually shut down by going to the Apple Menu and selecting "Shut Down…" what happens? This applescript basically does the same thing, so if there are more confirmations and dialogs, they're from whatever applications you are using, and have nothing to do with the operating system. And they're probably useful, preventing you from losing unsaved data.
  • JRobert
    JRobert almost 14 years
    You're close - in the AppleScript editor, select Run Only before you Save As Application. That should eliminate the Are You Sure dialog when you run it.
  • user3540003
    user3540003 over 13 years
    It's not the Run Only option but the Startup Screen option. Run Only means the script can't be edited.
  • Wisaroot K.
    Wisaroot K. over 11 years
    The method given in Answers 3, ie use AppleScript Editor by Ghoppe, works perfectly in OSX 10.8 Mountain Lion. One thing not clear was how to save it. That requires going to the top bar of the desktop to find save. Otherwise, it is the perfect solution.
  • David Richerby
    David Richerby about 8 years
    How does shutting down the machine from a terminal window achieve the goal of adding an icon to the desktop?