Quickly Change Between Light and Dark Mode in macOS With a Custom AppleScript App

macos mojave day night applescript

Apple makes it easy to switch between light and dark mode in macOS. Regardless of whether you’re just changing the Dock and Menu Bar (in Yosemite through High Sierra) or the entire system with Mojave’s new dark mode, you can swap between the light and dark options just by clicking a button in System Preferences.

But that’s still a few extra clicks, which can add up if you want to manually change light and dark modes multiple times throughout the day. Surely there must be a better way! Of course there is, it’s AppleScript.

As noted by reddit userĀ MirRelevant, a simple AppleScript app can let you switch between light and dark modes in any recent version of macOS with just a single click. To create your own script, launch AppleScript Editor on your Mac and enter the following code:

applescript light dark mode code

tell application "System Events"

    tell appearance preferences

        set dark mode to not dark mode

    end tell

end tell

applescript light dark mode save

Save the code as an application and give it a name and a location. You can now double-click to launch and test your dark/light mode switcher. Remember, if you’re not running Mojave, all you’ll see change is the Dock and Menu Bar (and Menu Bar menus, of course). On Mojave, you’ll get the full dark/light mode shift, including wallpaper changes if you have that option enabled.

mac light dark mode switcher app

If everything is working, drag your app to your Dock. From here, simply click once on the mode switcher app to change between light and dark mode in just a single click.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.