Light and Dark Mode Toggler AppleScript

This AppleScript toggles your macOS display between dark and light modes, letting you quickly adapt your favorite setting.

Click to view script…
tell application "System Events"
    tell appearance preferences
        set dark mode to not dark mode
    end tell
end tell