Auto-Enable Dark Mode for apps via Registry

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
iamMG
Posts: 28
Joined: 12 Nov 2017, 11:32

Auto-Enable Dark Mode for apps via Registry

07 Oct 2021, 11:36

Hi,
I made this script to auto-enable Dark mode for MS Word using a simple click on the entry in the Tray menu.

Code: Select all

#persistent
menu tray , NoStandard
menu tray , add , Dark Mode , ToggleDarkMode
iniRead darkModeEnabled , Settings.ini , Settings , darkModeEnabledEntry

ToggleDarkMode:
	if !darkModeEnabled	                ; Enable Dark Mode
		RegWrite REG_DWORD , HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Word\Options , DisableDarkMode , 0
	else    			                ; Disable Dark Mode
    	RegWrite REG_DWORD , HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Word\Options , DisableDarkMode , 1
	darkModeEnabled := !darkModeEnabled
	IniWrite %darkModeEnabled% , Settings.ini , Settings , darkModeEnabledEntry
return
To improve upon this, I intend to automate this process based on the current time. I have figured out an if condition that could help me in achieving this.

Code: Select all

if ((A_Hour < 9 or A_Hour > 18)

How do I automate this? (Preferably without Timers. Although it'd fine if they cannot be avoided.)
User avatar
mikeyww
Posts: 27246
Joined: 09 Sep 2014, 18:38

Re: Auto-Enable Dark Mode for apps via Registry

07 Oct 2021, 12:55

You could run your script at a specific time via the Windows Task Scheduler.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Spawnova and 161 guests