It is currently March 28th, 2024, 5:05 pm

Setting Option In Another Skin With LeftMouseDownAction

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am
Contact:

Setting Option In Another Skin With LeftMouseDownAction

Post by Mor3bane »

Hi
I am trying to use a button that is set as an image for the purpose of clicking to set the MeasureName option of a meter in a separate skin named "CenterTextLow".

This line is what I am trying, but for some reason I am having trouble with which Bang to use;-

Code: Select all

LeftMouseDownAction=[!SetOption "CentreTextLow" "MeasureName" "MeasurePing" "#@##SKINSPATH#\Round Meters\Right Lower Report\Right Lower Report.ini"]
Where or why is this so confusing? :?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by jsmorley »

Mor3bane wrote:Hi
I am trying to use a button that is set as an image for the purpose of clicking to set the MeasureName option of a meter in a separate skin named "CenterTextLow".

This line is what I am trying, but for some reason I am having trouble with which Bang to use;-

Code: Select all

LeftMouseDownAction=[!SetOption "CentreTextLow" "MeasureName" "MeasurePing" "#@##SKINSPATH#\Round Meters\Right Lower Report\Right Lower Report.ini"]
Where or why is this so confusing? :?
Use the config name of the skin, not the full path to the skin .ini file.

LeftMouseDownAction=[!SetOption "CentreTextLow" "MeasureName" "MeasurePing" "Round Meters\Right Lower Report"]

https://docs.rainmeter.net/manual/bangs/
Note: Many bangs have a Config parameter. Unless otherwise specified, valid values are the config name of a currently loaded skin to be acted upon or * (asterisk) to act on all currently loaded skins.
https://docs.rainmeter.net/manual/skins/#Config
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am
Contact:

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by Mor3bane »

works great now - i just over worked that bit of code.

:rosegift:
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by CodeCode »

Hello. Necroposting here.

I am trying to setvariable AND setoptiongroup in another skin.

I am trying this:

Code: Select all

[!SetVariable Timemode "5" "#@#Abbadon.inc"][!WriteKeyValue Variables Timemode "5" "#@#Abbadon.inc"][!ShowMeterGroup NullStyle "Another\Abbadon Time"][!RefreshGroup Abbadon]
Everything is working with the hope that the !ShowMeterGroup config is correctly referenced.

Does what I have look right? (at a galce?)(I can provide more info if needed).

Thanks,
CC
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by CodeCode »

CodeCode wrote: May 5th, 2022, 2:30 am Hello. Necroposting here.

I am trying to setvariable AND setoptiongroup in another skin.

I am trying this:

Code: Select all

[!SetVariable Timemode "5" "#@#Abbadon.inc"][!WriteKeyValue Variables Timemode "5" "#@#Abbadon.inc"][!ShowMeterGroup NullStyle "Another\Abbadon Time"][!RefreshGroup Abbadon]
Everything is working with the hope that the !ShowMeterGroup config is correctly referenced.

Does what I have look right? (at a galce?)(I can provide more info if needed).

Thanks,
CC
Ok. Never mind. Things are too weird with the issue I am working on. But I did get it to work, by not using a Refresh Bang. But that causes many other problems. I am going to go down the track of using variables rather then meter groups. :great:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by balala »

CodeCode wrote: May 5th, 2022, 2:30 am I am trying this:

Code: Select all

[!SetVariable Timemode "5" "#@#Abbadon.inc"][!WriteKeyValue Variables Timemode "5" "#@#Abbadon.inc"][!ShowMeterGroup NullStyle "Another\Abbadon Time"][!RefreshGroup Abbadon]
Everything is working with the hope that the !ShowMeterGroup config is correctly referenced.
To be honest, I doubt. The first bang ([!SetVariable Timemode "5" "#@#Abbadon.inc"]) can't work. It can't because the last parameter (#@#Abbadon.inc) is mistaken this way. If a !SetVariable bang (as well as most) has a last parameter, it has to be the name of a config, not the name of a file. #@#Abbadon.inc is a file, probably included included in your skin, however the !SetVariable bang can't set a variable into such a file, not even into a .ini file, but can into a skin, identified by a config name. Accordingly the above bang should be something like [!SetVariable Timemode "5" "Another\Abbadon Time"].
The second bang ([!WriteKeyValue Variables Timemode "5" "#@#Abbadon.inc"]) is correct from this point of view, at least assuming the Timemode variable is kept into the [Variables] section of the #@#Abbadon.inc file. !WriteKeyValue is the exception I talked about above, when I said:
If a !SetVariable bang (as well as most) has a last parameter, it has to be the name of a config, not the name of a file.
The last parameter of the !WriteKeyValue bang has to be a file, because this bang physically writes something (a variable for instance) to a file, so you have to specify the file in which the writing has to go on.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by CodeCode »

balala wrote: May 5th, 2022, 6:30 pm To be honest, I doubt. The first bang ([!SetVariable Timemode "5" "#@#Abbadon.inc"]) can't work. It can't because the last parameter (#@#Abbadon.inc) is mistaken this way. If a !SetVariable bang (as well as most) has a last parameter, it has to be the name of a config, not the name of a file. #@#Abbadon.inc is a file, probably included included in your skin, however the !SetVariable bang can't set a variable into such a file, not even into a .ini file, but can into a skin, identified by a config name. Accordingly the above bang should be something like [!SetVariable Timemode "5" "Another\Abbadon Time"].
The second bang ([!WriteKeyValue Variables Timemode "5" "#@#Abbadon.inc"]) is correct from this point of view, at least assuming the Timemode variable is kept into the [Variables] section of the #@#Abbadon.inc file. !WriteKeyValue is the exception I talked about above, when I said:

The last parameter of the !WriteKeyValue bang has to be a file, because this bang physically writes something (a variable for instance) to a file, so you have to specify the file in which the writing has to go on.
Yes, I realised that and changed it accordingly. It worked anyway, but I remembered that !SetVariable does not require a file explicitly, however, doesn't it mentioned that a specified config may be necessary in some cases? Just curious since in my case the function was between two skins - but, they share the same @Resources folder (not the inc, but ya the same folder seems to be the real decision maker in this case).
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by balala »

CodeCode wrote: May 6th, 2022, 12:40 am but I remembered that !SetVariable does not require a file explicitly, however, doesn't it mentioned that a specified config may be necessary in some cases?
A config is required when you want to set a variable into another skin then the current one. In such case you tell Rainmeter to apply the new value for the variable into the skin loaded from the specified config. If you don1t add a config name (as the last parameter), Rainmeter will (try to) apply the new value into the current skin (in which you're using the bang).
CodeCode wrote: May 6th, 2022, 12:40 am Just curious since in my case the function was between two skins - but, they share the same @Resources folder (not the inc, but ya the same folder seems to be the real decision maker in this case).
This is not important at all. Even if two different skins are using the same .inc (or any other type) file, you don't apply the new value into the included file, not even if the variable is defined into that file, but into the skin, which is identified by its config. This is why most bangs are using the name of the config, not the name of a file, if you need to apply it into another skin.
Additionally note that if a file is included into a skin (with a @Include option), the file is treated by Rainmeter like it was part of the skin. Rainmeter don't know and don't care where a variable, meter, measure or whatever is physically written. When included, the code of the included file becomes part of the code of skin.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by CodeCode »

balala wrote: May 6th, 2022, 3:58 pm A config is required when you want to set a variable into another skin then the current one. In such case you tell Rainmeter to apply the new value for the variable into the skin loaded from the specified config. If you don1t add a config name (as the last parameter), Rainmeter will (try to) apply the new value into the current skin (in which you're using the bang).
CodeCode wrote: May 6th, 2022, 12:40 amthey share the same @Resources folder (not the inc, but ya the same folder seems to be the real decision maker in this case).
balala wrote: May 6th, 2022, 3:58 pm This is not important at all. Even if two different skins are using the same .inc (or any other type) file, you don't apply the new value into the included file, not even if the variable is defined into that file, but into the skin, which is identified by its config. This is why most bangs are using the name of the config, not the name of a file, if you need to apply it into another skin.
Additionally note that if a file is included into a skin (with a @Include option), the file is treated by Rainmeter like it was part of the skin. Rainmeter don't know and don't care where a variable, meter, measure or whatever is physically written. When included, the code of the included file becomes part of the code of skin.
Well the line looks like this, they are in the same folder but are separate skins, and use separate inc files. It works fine - great even.
VariableBla=[!SetVariable Timemode "6"][!WriteKeyValue Variables Timemode "[#TimeMode]" "#@#Abbadon.inc"][!RefreshGroup Abbadon]
This is also in a inc file being used as a variable, so maybe that is why it works without the config after the SetVariable Bang?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Setting Option In Another Skin With LeftMouseDownAction

Post by balala »

CodeCode wrote: May 6th, 2022, 10:32 pm Well the line looks like this, they are in the same folder but are separate skins, and use separate inc files.
If they are in the same folder (these folders are called configs), only one of them can be activated at a time. In such case, you can't dynamically set a variable from one skin onto the other. For this both skins should be activated, which as said, is not possible if they are located into the same config. However you can write a variable (or any option) either to a .inc file (doesn't matter if it is included into the current skin or not), or a .ini file, other than the one of the current skin.
CodeCode wrote: May 6th, 2022, 10:32 pm VariableBla=[!SetVariable Timemode "6"][!WriteKeyValue Variables Timemode "[#TimeMode]" "#@#Abbadon.inc"][!RefreshGroup Abbadon]
This is also in a inc file being used as a variable, so maybe that is why it works without the config after the SetVariable Bang?
When applied, the value for the Timemode variable is set into the skin in which this variable is applied. As said, doesn't matter if the variable is declared into the skin's .ini or an included .inc file, Rainmeter doesn't really care where it is placed.
Post Reply