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