Maybe this applescript code will help a bit
tell application "System Preferences"
reveal anchor "Main" of pane id "com.apple.preference.general"
end tell
tell application "System Events"
repeat until exists of checkbox "Dark" of window "General" of application process "System Preferences"
delay 0.1
end repeat
-- Appearance
click checkbox "Dark" of window "General" of application process "System Preferences"
-- Accent Color
click checkbox "Red" of window "General" of application process "System Preferences"
-- Dropdown Menu For Highlight Color
click pop up button 1 of window "General" of application process "System Preferences"
-- Highlight Color
click menu item "Red" of menu 1 of pop up button 1 of window "General" of application process "System Preferences"
end tell
tell application "System Preferences" to quit
UPDATE:
Taking it one step further, save this following AppleScript code as an application. When this new app is launched, it allows for choosing your different color modes.
property appearanceMode : {"Light", "Dark"}
property accentColors : {"Blue", "Purple", "Pink", "Red", "Orange", "Yellow", "Green", "Graphite"}
property highlightColors : {"Blue", "Purple", "Pink", "Red", "Orange", "Yellow", "Green", "Graphite", "Other"}
activate
set chosenAppearanceMode to (choose from list appearanceMode ¬
with title "Please Choose Your Appearance Mode" with prompt ¬
"Please Choose Your Appearance Mode" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenAppearanceMode is "false" then return
activate
set chosenAccentColor to (choose from list accentColors ¬
with title "Please Choose Your Accent Color" with prompt ¬
"Please Choose Your Accent Color" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenAccentColor is "false" then return
activate
set chosenHighlightColor to (choose from list highlightColors ¬
with title "Please Choose Your Highlight Color" with prompt ¬
"Please Choose Your Highlight Color" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenHighlightColor is "false" then return
try
if application "System Preferences" is running then do shell script "killall 'System Preferences'"
end try
repeat until application "System Preferences" is not running
delay 0.1
end repeat
tell application "System Preferences" to reveal anchor "Main" of pane id "com.apple.preference.general"
tell application "System Events"
repeat until exists of checkbox chosenAppearanceMode of window "General" of application process "System Preferences"
delay 0.1
end repeat
-- Appearance
click checkbox chosenAppearanceMode of window "General" of application process "System Preferences"
-- Accent Color
click checkbox chosenAccentColor of window "General" of application process "System Preferences"
-- Dropdown Menu For Highlight Color
click pop up button 1 of window "General" of application process "System Preferences"
-- Highlight Color
click menu item chosenHighlightColor of menu 1 of pop up button 1 of window "General" of application process "System Preferences"
end tell
try
if application "System Preferences" is running then do shell script "killall 'System Preferences'"
end try
SIDENOTE: My reason for using the the do shell script "killall 'System Preferences'"
command rather than tell application "System Preferences" to quit
is... Let's say, for what ever reason, System Preferences.app is already activated (with, for example, window Sharing/ Remote Management/ Computer Settings open) but not visible or not front most or whatever. In Script Editor, you try to run tell application "System Preferences" to reveal anchor "SpeakableItems" of pane id "com.apple.preference.universalaccess"
That command completes with no obvious errors but when you switch over to System Preferences, your "revealed anchor" is not revealed. Ok, no big deal, easy fix. I'll just insert a tell application "System Preferences" to quit
command prior to the reveal anchor
command. Running the updated code this time, you get a (userCanceledErr:-128) error. All of this hassle is because that secondary drop down window in System Preferences is open. In my opinion, the do shell script "killall 'System Preferences'"
command seems to be the best solution.
I resolved the issue. Turns out that my dark mode preferences switched back to Light mode. When I turned Dark Mode back on, Pages switch to Dark mode as well.
Looks like I have a different problem... My Dark Mode seems to be switching back to light mode from time to time.
I resolved this toggle issue here:
https://apple.stackexchange.com/a/337808/183752
Best Answer
Easy. Open up your terminal and write: