It switches betwen Dark Mode and Light Mode, quickly, from your menu bar. You can schedule the change, if you like, so that you could have Light Mode at 8am and Dark Mode at, say, 6pm.
It’s pretty useful while working on Mac projects to quickly check out how things look in Dark Mode.
It’s for macOS Mojave. It was made with Xojo. It’s free.
It switches betwen Dark Mode and Light Mode, quickly, from your menu bar. You can schedule the change, if you like, so that you could have Light Mode at 8am and Dark Mode at, say, 6pm.
It’s pretty useful while working on Mac projects to quickly check out how things look in Dark Mode.
It’s for macOS Mojave. It was made with Xojo. It’s free.
[quote=434966:@Gavin Smith]I used to have a bit of code that did this but I haven’t used it since the Sandbox days - does yours work in a Sandboxed app?
[/quote]
Nope, apparently you’d have to use a helper app to do it in the sandbox. Your old code is probably very close to my code. I haven’t needed it in a sandboxed app. It looks like you’d just have to split out the settings window from the menu item / scheduled switching parts and place the helper in Contents/Library/LoginItems and enable it with SMLoginItemSetEnabled.
It looks like it’s not too difficult aside from that. Here’s a how-to article. Apparently it also only works if the App is in /Applications.
…Or just tell users how to add it to login items (It is free after all). Thanks for putting this together BTW. Very helpful!
I just ran the app on Catalina and noticed that it appears in the System Prefs > Security & Privacy > Privacy > Automation list with “System Events” checked. Can I ask if you did anything to get your app to appear here?
The reason I ask is I have an app that also needs to talk to System Events via AppleScript. The app is listed and checked in the “Accessibility” list but doesn’t show in the “Automation” list. When I try to run an AppleScript in my app that talks to System Events I get the error: “Not authorized to send Apple events to System Events…” - Error No = -1743. In Mojave I’m prompted with a message that my app is trying to control System Events with the option to click “Okay”, and then the app appears in the Automation list. Now with Catalina this message no longer happens. So I just wanted to check if had this issue or if do anything special to have your app appear in the “Automation” list.
@Gavin Smith - Sorry to bug you on this. I worked out why my app wasn’t able to get onto the Automation list. I use AppWrapper to wrap my app and set NSAppleEventsUsageDescription in the app’s plist.info file. There is something in my AppWrapper setup (probably something to do with Hardening it) that is stopping this from working. If I add just the NSAppleEventsUsageDescription lines manually the app works. BTW you may want to update your plist NSAppleEventsUsageDescription entry to something like:
NSAppleEventsUsageDescription
Dark Mode Switcher needs to script System Events in order to change the current theme