Toggle Dark Mode
A Mac OS command that uses AppleScript
Run Toggle Dark Mode in Command Bar
This is an example that will only work on macOS because it uses AppleScript. It's an example of a command that doesn't return a response: it just does its thing and exits.
When the command is run, it will toggle the dark mode system preference setting.
Paste the following code in a new file with a .applescript extension and then create a Local Command to try it out in Slapdash.
1
tell application "System Events"
2
tell appearance preferences
3
set dark mode to not dark mode
4
end tell
5
end tell
Copied!
Last modified 6d ago
Copy link