Skip to content

Instantly share code, notes, and snippets.

@jmcerrejon
Created April 18, 2025 16:19
Show Gist options
  • Save jmcerrejon/cacfca8dfa92606a1eb7220bcd7d2a92 to your computer and use it in GitHub Desktop.
Save jmcerrejon/cacfca8dfa92606a1eb7220bcd7d2a92 to your computer and use it in GitHub Desktop.
Close all apps that are currently open and shut down your Mac using the Automator script. Because I prefer to switch to a Mac and start from scratch πŸ˜‰
on run {input, parameters}
tell application "System Events"
set appList to name of every application process where background only is false
end tell
repeat with appName in appList
try
do shell script "killall '" & appName & "'"
end try
end repeat
delay 1
do shell script "shutdown -h now" with administrator privileges
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment