Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
One click and be ready to go up on stage and shine! -
# Turn on Notifications
do shell script "defaults -currentHost write doNotDisturb -bool FALSE; defaults -currentHost delete doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
# Disable Notifications
set tDate to do shell script "date -u \"+%Y-%m-%dT%TZ\"" -- the current date in UTC time. --> "2016-04-04T17:03:04Z"
do shell script "defaults -currentHost write doNotDisturb -bool TRUE; defaults -currentHost write doNotDisturbDate -date " & tDate & "; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" --this set 'Do not disturb' to true in the pref
# Hide Desktop
do shell script "defaults write CreateDesktop -bool false; killall Finder"
# Hide all windows
tell application "System Events"
set listOfProcesses to (name of every process where visible is true)
repeat with appName in listOfProcesses
if {"Sketch", "Keynote"} contains appName then return
tell application "Finder" to set visible of process appName to false
end repeat
end tell
Copy link

wouter-wh commented Nov 23, 2017

Made an alias in my .bash_profile to run both scripts. But I get the following error; "pliim-turnOn.scpt:722:758: execution error: System Events got an error: Can’t make collapsed of every window into type specifier. (-1700)"; Running on iMac, late 2013; macOS10.13.1


Copy link

zehfernandes commented Nov 26, 2017

Hi @wouterhoogstra

I update the pliim-turnOn.scpt script

Thanks for reporting.


Copy link

procload commented Nov 29, 2017

I received the following error: error "Finder got an error: Unknown AppleEvent address type." number -1716 is that known?


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