Theme shortcut

  • Thread starter Thread starter Eustace
  • Start date Start date
E

Eustace

Is there any way to create a shortcut to apply a theme? If you click a
theme.theme file it brings up the dialog and you have to click Apply or
OK. Is there any way to avoid that extra step?
 
Eustace,



Doing a quick test, you can save a registry file that will change the Theme
but I wasn't able to return to that Theme until I clicked 'Apply'. I thought
refreshing the screen might do it but to no avail. Anyway the location for
the Theme is at: HKEY_CURRENT_USER\Software\Microsoft\Plus!\Themes\Current



Drew
 
Eustace said:
Is there any way to create a shortcut to apply a theme? If you click a
theme.theme file it brings up the dialog and you have to click Apply or
OK. Is there any way to avoid that extra step?

Scripting it using Windows Script Host would be one way.

The following script (paste the code between the stars into notepad and save
with a .vbs extension) should do it for a theme path you specify in line 2.
[Watch out for word wrap on line 2 - path all on one line]

'******************************************************************
Set WshShell = WScript.CreateObject("WScript.shell")
Theme = "C:\Documents and Settings\USERNAMEHERE\My
Documents\Themes\NAMEOFTHEME.theme"


runstring = chr(34) & Theme & chr(34)
WshShell.Run runstring

'Activate the window
counter = 600
activated = false
do
activated = WshShell.AppActivate("Display Properties")
wscript.sleep 100
counter = counter - 1
if counter = 0 then
wscript.quit
end if
loop until activated = true

wshshell.sendkeys "{ENTER}"

'***************************************************************
 
Eustace said:
Is there any way to create a shortcut to apply a theme? If you click a
theme.theme file it brings up the dialog and you have to click Apply
or OK. Is there any way to avoid that extra step?

Scripting it using Windows Script Host would be one way.

The following script (paste the code between the stars into notepad and
save with a .vbs extension) should do it for a theme path you specify in
line 2.
[Watch out for word wrap on line 2 - path all on one line]

'******************************************************************
Set WshShell = WScript.CreateObject("WScript.shell")
Theme = "C:\Documents and Settings\USERNAMEHERE\My Documents\Themes\NAMEOFTHEME.theme"


runstring = chr(34) & Theme & chr(34)
WshShell.Run runstring

'Activate the window
counter = 600
activated = false
do
activated = WshShell.AppActivate("Display Properties")
wscript.sleep 100
counter = counter - 1
if counter = 0 then
wscript.quit
end if
loop until activated = true

wshshell.sendkeys "{ENTER}"

'***************************************************************

Thanks a lot Jon. It does what I wanted to, there is however one small
problem: I created shortcuts to the 2 files I created intending to apply
shortcut keys (Alt+Ctrl+letter) to them but then I realized that the
shortcut keys to these kind of shortcuts do not work.

So I would like to ask you one more thing: Is it possible to create a
toggle shortcut that

- checks the current theme,
- if it is not My White Theme it applies the My White Theme,
- if it is My White Theme it applies My Blue Theme

If I had such a shortcut I would put it in the Quick Lauch area for easy
access. I would prefer not to have 2 theme shortcuts sitting there...

Thanks again,

Eustace
 
Eustace said:
Is there any way to create a shortcut to apply a theme? If you click a
theme.theme file it brings up the dialog and you have to click Apply
or OK. Is there any way to avoid that extra step?

Scripting it using Windows Script Host would be one way.

The following script (paste the code between the stars into notepad and
save with a .vbs extension) should do it for a theme path you specify in
line 2.
[Watch out for word wrap on line 2 - path all on one line]

'******************************************************************
Set WshShell = WScript.CreateObject("WScript.shell")
Theme = "C:\Documents and Settings\USERNAMEHERE\My
Documents\Themes\NAMEOFTHEME.theme"


runstring = chr(34) & Theme & chr(34)
WshShell.Run runstring

'Activate the window
counter = 600
activated = false
do
activated = WshShell.AppActivate("Display Properties")
wscript.sleep 100
counter = counter - 1
if counter = 0 then
wscript.quit
end if
loop until activated = true

wshshell.sendkeys "{ENTER}"

'***************************************************************

Thanks, Jon. I have a follow-up request, but I'll post as a new subject.
 
Eustace said:
Eustace said:
Is there any way to create a shortcut to apply a theme? If you click a
theme.theme file it brings up the dialog and you have to click Apply or
OK. Is there any way to avoid that extra step?

Scripting it using Windows Script Host would be one way.

The following script (paste the code between the stars into notepad and
save with a .vbs extension) should do it for a theme path you specify in
line 2.
[Watch out for word wrap on line 2 - path all on one line]

'******************************************************************
Set WshShell = WScript.CreateObject("WScript.shell")
Theme = "C:\Documents and Settings\USERNAMEHERE\My
Documents\Themes\NAMEOFTHEME.theme"


runstring = chr(34) & Theme & chr(34)
WshShell.Run runstring

'Activate the window
counter = 600
activated = false
do
activated = WshShell.AppActivate("Display Properties")
wscript.sleep 100
counter = counter - 1
if counter = 0 then
wscript.quit
end if
loop until activated = true

wshshell.sendkeys "{ENTER}"

'***************************************************************

Thanks, Jon. I have a follow-up request, but I'll post as a new subject.

Ok, spotted - have responded in your followup thread.
ie "Shortcut to toggle themes?"

Jon
 
Back
Top