It is currently April 24th, 2024, 10:35 am

Sharing variable values between skins

General topics related to Rainmeter.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Sharing variable values between skins

Post by rbriddickk84 »

balala wrote: August 29th, 2023, 6:36 pm If we're using the !SetVariable bang, the skin in which we want to set the variable has to be activated, as you described, however if instead we're using the !SetVariableGroup bang, if the skin in cause is activated, the variable is set, however if it's inactive, nothing happens. No error messages, nothing. Much easier, in my opinion.
This suggestion is a nice idea. I often use "group" bangs in many types, meters, measures, variables sometimes, tho this was my first time (for some weird reason) to pass directly variable to another skin. :)
Also i am often using the "if skin is activated" lookup before i take external actions, but good reminder! ;) :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sharing variable values between skins

Post by balala »

rbriddickk84 wrote: August 30th, 2023, 6:07 am I often use "group" bangs in many types, meters, measures, variables sometimes,
Yes, but here we're talking about group of skins, which is another story. See below...
rbriddickk84 wrote: August 30th, 2023, 6:07 am Also i am often using the "if skin is activated" lookup before i take external actions, but good reminder! ;) :thumbup:
How do you do a "if skin is activated" lookup? By an ActiveConfig plugin measure or did you find another way?
However, strictly related to the question you had, here is a short example. Assuming you want to change a variable (let's name it Something) into the Skins\illustro\Clock\Clock.ini skin (yes, I know there is no such a variable, but I chose this only to can easier explain). You can use the following option onto any other skin: LeftMouseUpAction=[!SetVariable Something "12" "illustro\Clock"] (don't take into account the update of the appropriate measures and / or meters inot the Clock.ini skin, nor the redraw of the skin, these are not important from the point of view of what I want to describe). If a skin of the Skins\illustro\Clock config is active (namely Clock.ini), the bang works well, setting the value. However if the Clock skin (or any other of the named config, if there is any) is not active, you immediately get an error in the log.
Now if you add a Group=MyClock (or obviously use another name) option to the [Rainmeter] section of the Skins\illustro\Clock\Clock.ini skin and you alter a little bit the above LeftMouseUpAction for instance to this form: LeftMouseUpAction=[!SetVariableGroup Something "12" "MyClock"], you never get the error message once again, no matter if the Clock.ini skin is active or not, when you click the meter having set the above LeftMouseUpAction option.
This is an extremely simple solution, which makes not necessary using an ActiveConfig plugin measure (or any other way), to check if the skin in which you want to set the variable, is loded or not.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Sharing variable values between skins

Post by rbriddickk84 »

balala wrote: August 30th, 2023, 6:30 am How do you do a "if skin is activated" lookup? By an ActiveConfig plugin measure or did you find another way?
Yep, i am using this plugin https://forum.rainmeter.net/viewtopic.php?p=149824#p149824
So far i think is the best way to do it, idk i didn't checked for other way for a long time now. :confused:
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sharing variable values between skins

Post by balala »

rbriddickk84 wrote: August 30th, 2023, 10:53 am Yep, i am using this plugin https://forum.rainmeter.net/viewtopic.php?p=149824#p149824
So far i think is the best way to do it, idk i didn't checked for other way for a long time now. :confused:
Which other way? Me personally don't know about other way, but there might be though.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: Sharing variable values between skins

Post by rbriddickk84 »

balala wrote: August 30th, 2023, 11:26 am Which other way? Me personally don't know about other way, but there might be though.
Well i was just saying that i don't know any other way to do that since i looked for it long ago and found that plugin. :)
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sharing variable values between skins

Post by balala »

rbriddickk84 wrote: August 30th, 2023, 7:30 pm Well i was just saying that i don't know any other way to do that since i looked for it long ago and found that plugin. :)
As far as I know, there is no other way.