AppleScript · Silent
Toggle Dark Mode
Switches macOS between Light and Dark appearance. The first run asks for permission to control System Events.
- Language
- AppleScript
- Output
- Silent
- Keyword
dark- Arguments
- None
- Licence
- MIT
- Author
- Docktopus
- File
- toggle-dark-mode.applescript (552 bytes)
- Downloads
- 0
In Docktopus: Settings → Scripts → Browse Community Scripts. Read the source before you run any script.
Source
toggle-dark-mode.applescript · sha256 6c037eb1bac3…-- @docktopus.schemaVersion 1
-- @docktopus.title Toggle Dark Mode
-- @docktopus.mode silent
-- @docktopus.icon circle.lefthalf.filled
-- @docktopus.keyword dark
-- @docktopus.description Switches macOS between Light and Dark appearance. The first run asks for permission to control System Events.
-- @docktopus.author Docktopus
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
set isDark to dark mode
end tell
end tell
if isDark then
return "Dark Mode is on."
else
return "Light Mode is on."
end if