Dark Mode in Mojave

Apple has no official way to detect when an app is in Dark Mode. There’s a way using defaults that most people use, however we have one report that suggests it’s failing under Mojave. So I’d appreciate anyone running Mojave taking a minute or two to run the following code in Script Debugger 8 in both Lite Mode and Dark Mode, and adding the resulting strings to this topic.

use framework "Foundation"
use framework "AppKit"

set theVers to current application's NSProcessInfo's processInfo()'s operatingSystemVersionString()
set theName to current application's NSApp's effectiveAppearance()'s |name|()
set theString to current application's NSUserDefaults's standardUserDefaults()'s objectForKey:"AppleInterfaceStyle"
tell application id "com.apple.systemevents" -- System Events.app
	tell appearance preferences
		set isDark to dark mode
	end tell
end tell
return current application's NSString's stringWithFormat_("%@, appearance name: %@, interface style: %@, isDark: %@", theVers, theName, theString, isDark) as text

Hi Shane.

With the system in Light Mode and Dark mode respectively:

“Version 10.14.6 (Build 18G7016), appearance name: NSAppearanceNameAqua, interface style: (null), isDark: 0”

“Version 10.14.6 (Build 18G7016), appearance name: NSAppearanceNameDarkAqua, interface style: Dark, isDark: 1”

After switching to SD8’s “Default Dark” theme while in Dark Mode, running the script again caused SD8 to quit suddenly. Now it’s forgotten my AS formatting preferences. :frowning: (Edit: Fixed by switching to the “My Snapshot” theme. :slight_smile: )

Thanks, @NigelGarvey. Anyone else?

macOS: Mojave 10.14.6 (18G7016), Script Debugger 8.0 (8A16)

[Light mode]
Version 10.14.6 (Build 18G7016), appearance name: NSAppearanceNameAqua, interface style: (null), isDark: 0

I’m not able to run anything in Dark mode in current version Script Debugger 8.0 (8A16)

Ps.
It could be a bad experience to use highlight color for select text in text editor.
Script Debugger use highlight color that is darker and ex. TextEdit in Dark mode.

Light mode in Mojave:

Version 10.14.6 (Build 18G103), appearance name: NSAppearanceNameAqua, interface style: (null), isDark: 0

Dark mode in Mojave - when I open SD8 and select AppleScript Applet as the kind of script I want to create, SD8 crashes. However, when I launch it from this web page (clicking on Open in Script Debugger), I can run the script and I get this result:

Version 10.14.6 (Build 18G103), appearance name: NSAppearanceNameDarkAqua, interface style: Dark, isDark: 1

Could you expand on that a bit?

If you haven’t already, please send a crash report.

First time open Script Debugger in Dark mode was possible, I was in dictionary view.
I open system preference and change to Light mode, I change back to Dark mode and
Script Debugger crashed. Now its only possible to start Script Debugger in Dark mode to
Choose a template for your new script dialog. If I press choose it will crash.
So that is wha I mean I couldn’t use Script Debugger 8 in Dark mode in Mojave.

In Light mode its possible to start Script Debugger 8 without any issue in that regard.

Shane, Will reboot to Mojave in a day or two and will send a report.

Thanks — we’re looking for feedback on what users think the default Dark Mode colors.

Let me explain what you see now. The default light settings is Apple’s default format styles, plus Script Debugger 7’s default values for the other colors. To build the dark modes, we essentially took the light values, changed to a dark background, and then manually tweaked to make things more readable, but still bearing a relationship to the lite version where possible.

It was inherently subjective, and the expectation was that the dark colors would change before shipping, based in feedback.

So what we’d love is for people to suggest not just which colors they find hard, but also to suggest alternative values that work.

BBEdit is a good example, Shane check that

You could make some python script in BBEdit and you will see what I mean.

I assure you, I’ve looked at it, and many other apps. But they generally serve a different purpose — none of them faithfully styles AppleScript.

As I said, we’re really after specific feedback for individual styles if possible.

You could also check out adaptive color model here is good inspiration.

Here is the info:

@ShaneStanley - I tried again opening SD8 in Mojave dark mode and selected AppleScript/AppleScript as a template, and got a crash as before. Crash report submitted.

Thanks for the report.