It is currently March 28th, 2024, 7:57 pm

Should we place Mouse action only in [Rainmeter] section

Get help with creating, editing & fixing problems with skins
Gangula
Posts: 14
Joined: January 28th, 2018, 8:45 am

Should we place Mouse action only in [Rainmeter] section

Post by Gangula »

I want to use a variable that I stored in "Variables.inc" file in the "@Resources" folder. But when I move that action out of the [Rainmeter] section, they stop working. This variable that I want to use is extracted from "TIMEZONE_BIAS". Below is the code. I'm not sure what I'm missing.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
; 1320/24 = 55(total 24 timezones/24 hour difference),  12+5.5(5.5 indian time zone) = 17.5,  17.5*55 = 962.5
OnRefreshAction=!Move "962.5" "0" 
LeftMouseUpAction=!Move "962.5" "0"
This code works perfectly fine, but when I move the above actions out of [Rainmeter] section to any [Meter] section it doesn't work.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Should we place Mouse action only in [Rainmeter] section

Post by balala »

Gangula wrote:This code works perfectly fine, but when I move the above actions out of [Rainmeter] section to any [Meter] section it doesn't work.
The OnRefreshAction option doesn't work outside of the [Rainmeter] section, can't be used anywhere else.
The LeftMouseUpAction works on any meter, but it is executed only if you click that meter, not on any other.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Should we place Mouse action only in [Rainmeter] section

Post by eclectic-tech »

The 'OnRefreshAction' bang only works in the [Rainmeter] section. If you want to use this in a meter section, that bang will not work. (balala beat me!)

I would create a string measure to test the variable, and move the skin when the variable changes:

Code: Select all

[MeasureBias]
Measure=String
String=#TIMEZONE_BIAS#
OnChangeAction=!Move "962.5" "0"
Gangula
Posts: 14
Joined: January 28th, 2018, 8:45 am

Re: Should we place Mouse action only in [Rainmeter] section

Post by Gangula »

The main issue is that I need to use a variable in the OnRefresh & Onchange actions. So I need to place them after the [variables] section. Can I achieve this in any other way?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Should we place Mouse action only in [Rainmeter] section

Post by balala »

Gangula wrote:The main issue is that I need to use a variable in the OnRefresh & Onchange actions. So I need to place them after the [variables] section. Can I achieve this in any other way?
Not sure I understood what you would like to do. If you define a variable in the [Variables] section, you can use it in any section, including [Rainmeter]. The [Rainmeter] section can be placed anywhere, either before or after the [Variables] section. And doesn't matter where you put it, you can use the variable. Or many times you can use even a variable which isn't defined in the [Variables] section.