Skip to content

Instantly share code, notes, and snippets.

@aont
Created February 12, 2012 10:37
Show Gist options
  • Select an option

  • Save aont/1807804 to your computer and use it in GitHub Desktop.

Select an option

Save aont/1807804 to your computer and use it in GitHub Desktop.
Apple Script Shutdown
#!/usr/bin/osascript
-- tell application "loginwindow" to «event aevtrrst»
tell application "loginwindow" to «event aevtrsdn»
tell application "System Events"
tell window 1 of process "loginwindow"
click checkbox 1
-- click button 2
end tell
end tell
@spookey

spookey commented Dec 1, 2016

Copy link
Copy Markdown

How about tell app "System Events" to shut down?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment