Quickly toggle your Mac's System Appearance via Spotlight (Command–Space bar).
Preview.mov
This is the entire script, there's not much to it.
tell application "System Events" to tell appearance preferences
set dark mode to not dark mode
end tell