It is currently May 2nd, 2024, 3:31 am

AHK Script to bring skins to front

General topics related to Rainmeter.
Maudric
Posts: 2
Joined: September 21st, 2011, 4:05 pm

AHK Script to bring skins to front

Post by Maudric »

Hi, I've been trying to write an ahk script to bring my RainMeter skins to front (not to show the desktop, just to show the skin on top of whatever application I have active at the moment)

So far, this is what I have come up with:

Code: Select all

#f:: ;Windows + F  (F)orces RM Skin to top
{
	If(WinExist("ahk_class RainmeterMeterWindow")) ;class name of skin you wish to bring to front
		#WinActivateForce
return
} 
However, this doesn't seem to work - as such, I was wondering if there was an AHK guru out there that could determine the reason why it doesn't work.

Thank you,
Maudric

*Edit: Removed "(Need Help)" from title
Last edited by Maudric on September 21st, 2011, 7:04 pm, edited 1 time in total.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: AHK Script to bring skins to front (Need Help)

Post by MerlinTheRed »

I'm no expert in this, but I believe you could use the !Zpos bang to set a config or group of configs to "stay topmost" for a short period of time. When you don't need them at the front any more, send a bang that reverts the position back to "On Desktop".

To send a bang to Rainmeter, I think you can use something like C:\path\to\rainmeter.exe "!ZPos 2 Configname"
(I didn't find the appropriate page for Rainmeter command line options in the manual, but you can find the !ZPos Bang here: http://rainmeter.net/cms/Bangs)

Sorry for the half-informed comment. I hope I could point you in the right direction.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Maudric
Posts: 2
Joined: September 21st, 2011, 4:05 pm

Re: AHK Script to bring skins to front (Need Help)

Post by Maudric »

I'm no expert in this, but I believe you could use the !Zpos bang to set a config or group of configs to "stay topmost" for a short period of time. When you don't need them at the front any more, send a bang that reverts the position back to "On Desktop".
Thanks a lot for the response, MerlinTheRed!

This is the code I have now, and it seems to work:

Code: Select all

#f:: ;Windows + F  (F)orces RM Skin to top
{
		Run "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterZPos 2 "C:\Users\------------\Documents\Rainmeter\Skins\DiskDock\Settings\RainConfigure.cfg"	
return
} 
Paired with this code in my rainmeter skin:

Code: Select all

MouseLeaveAction=!Execute [!RainmeterZposGroup -2 DiskDock]
So, pressing Windows + f brings my skin to the front so that I can mouseover it, then when I move my mouse off, it disappears again.

Note that the skin must be set by default to a position of 2 (top most)

Thank you,
Maudric

*Edit
FYI, you don't need to send the "refresh" command when changing position with the !ZPos command. :)
Thank you Kaelri!
Last edited by Maudric on September 21st, 2011, 8:49 pm, edited 2 times in total.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: AHK Script to bring skins to front

Post by Kaelri »

Code: Select all

Run "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterRefresh
FYI, you don't need to send the "refresh" command when changing position with the !ZPos command. :)