Thursday, October 17, 2019

#1 2019-10-08 11:14:45 pm

juu029
Member
Registered: 2019-10-08
Posts: 2

Dark mode not working because of previous AppleScript

Hi All,

I used the following AppleScript last year when Mojave came out to create a keyboard shortcut to toggle between Dark Mode:

Applescript:


tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell

Now, I'm attempting to use the Auto Appearance feature in Catalina for dark mode, but "Auto" seems to be the same as Dark appearance.

The value that appears in the System Preferences > General screen does not always match the actual status. For example, if I set the System Preferences screen to Light mode, run the Apple Script and set it to Dark, the System Preferences screen remains selected on Light.

So the question is -- how can I delete this variable set by AppleScript? I tried creating another script and setting it to null, "", missing value, but none of these works. Is there a command in Apple Script to make it forget the value, or a file I can physically modify or remove on the hard drive to get rid of it?

This issue is specific to the account I ran this on, as I created a new account as a test and it successfully set the appearance based on time of day when on the Auto settingo n that new account. It also does not seem the value is stored anywhere in ~/Library, as I tried moving that directory temporarily, everything reset, but the behavior of this setting did not change.

Thank you in advance for any assistance you can provide!

Last edited by juu029 (2019-10-08 11:22:46 pm)

Offline

 

#2 2019-10-09 05:54:40 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 618

Re: Dark mode not working because of previous AppleScript

It is very strange. Try to quit "System Events" after script running and then relaunch again.

2) You use keyboard shortcut to this snippet saved as app? Check if this shortcut is still enabled in keyboard preferences.

Last edited by KniazidisR (2019-10-09 06:00:12 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

#3 2019-10-09 08:46:03 am

juu029
Member
Registered: 2019-10-08
Posts: 2

Re: Dark mode not working because of previous AppleScript

I tried quitting System Events but no luck.

I had it setup as a Keyboard Shortcut but removed it the evening I installed Catalina. But I've been running the script manually from the command line since then.

Offline

 

#4 2019-10-10 08:08:33 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 618

Re: Dark mode not working because of previous AppleScript

Hi, juu029.
I am sorry. I have not installed  Catalina yet to help more.

You say "This issue is specific to the account I ran this on". So, try set manually dark mode to not "AUTO". Then set manually to Light mode, then set again manually to "AUTO". Check, if you have any stay-open application on your Mac, which changes the  behaviour. Or, maybe, you have some folder action installed, which changes the  behaviour. Or, maybe, you have some custom service installed (quick action), which changes the  behaviour.

Last edited by KniazidisR (2019-10-10 08:18:05 am)


macOS Mojave -- version 10.14.4
Safari -- version 12.1

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)