Yes, it is. The !WriteKeyValue bang can do this. For example add the following option to the WebParser measure which returns the value: OnChangeAction=[!WriteKeyValue Variables MyVariable "[#CURRENTSECTION#]" "#@#Information.inc"], along with a DynamicVariables=1 option. The bangs of an OnChangeAction option are executed when the value returned by the measure where it is placed in, is changing. So whenever this measure gets a new value, the !WriteKeyValue bang is executed and this bang writes the value of the measure into the MyVariable variable, within the [Variables] section of the Information.inc file, existing into the @Resources folder. Note that you can write this value into any .ini formatted file, regardless where is it placed, just have to add its path as the last parameter of the !WriteKeyValue bang. Also note that the file MUST exist (it isn't created if it doesn't exist) and it MUST have a .ini file structure, having a [Variables] section.
It is currently March 29th, 2024, 2:03 am
Measure information from application
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure information from application
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: Measure information from application
Thanks, will go through this soon!balala wrote: ↑June 8th, 2019, 6:01 pm Yes, it is. The !WriteKeyValue bang can do this. For example add the following option to the WebParser measure which returns the value: OnChangeAction=[!WriteKeyValue Variables MyVariable "[#CURRENTSECTION#]" "#@#Information.inc"], along with a DynamicVariables=1 option. The bangs of an OnChangeAction option are executed when the value returned by the measure where it is placed in, is changing. So whenever this measure gets a new value, the !WriteKeyValue bang is executed and this bang writes the value of the measure into the MyVariable variable, within the [Variables] section of the Information.inc file, existing into the @Resources folder. Note that you can write this value into any .ini formatted file, regardless where is it placed, just have to add its path as the last parameter of the !WriteKeyValue bang. Also note that the file MUST exist (it isn't created if it doesn't exist) and it MUST have a .ini file structure, having a [Variables] section.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure information from application
Ok. If you have questions, feel free to come back.
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: Measure information from application
It works! But what about writing the string of multiple measure values to the information.ini file?
Code: Select all
[MeterLaunchImageSSD1]
Meter=Image
ImageName=#@#ssd.png
W=15
H=15
X=10
Y=35
MouseOverAction=[!ShowMeter HoverActiveSSD1]
MouseLeaveAction=[!HideMeter HoverActiveSSD1]
LeftMouseUpAction=[!WriteKeyValue Variables MyVariable1 [MeasureUser1SSD1] "#@#Information.ini"]
LeftMouseUpAction=[!WriteKeyValue Variables MyVariable2 [MeasureUser2SSD1] "#@#Information.ini"]
DynamicVariables=1
But MyVariable2 is empty and not showing Value of MeasureUser2SSD1
EDIT: FIXED, I SHOULDNT HAVE TWO LEFTMOUSEUPACTIONS, JUST ONE WITH MULTIPLE !WRITEKEYVALUE.
Last edited by balala on June 9th, 2019, 1:53 pm, edited 5 times in total.
Reason: When posting code snippets, please post it between <code> tags. It can be done with the </> button.
Reason: When posting code snippets, please post it between <code> tags. It can be done with the </> button.
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: Measure information from application
You did say to add this to the MeasureUserSSD1 which is actually the measure with the webparser, but I have two issues with it:
Does this mean it will write to the information.ini file, every time the value changes? What is if this is very frequent (i.e, a very low update rate?). This might be too much. I just want to view the information at regular rate, but not write to a file so often.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure information from application
Every option of every section can be used only once. If you add secondly the same option, the second occurrence of it is ignored. That's why MyVariable1 was written properly, while MyVariable2 wasn't.
Note that not just the options can't be doubled, nor the section names can't. If you do double a section name into one single skin, the second occurrence of it is ignored as well as the second occurrence of the option.
This is the way as .ini files are working. No doubling anything.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Measure information from application
The bangs of an OnChangeAction option are executed whenever the value of the measure you added the option to is changing. Note that you don't have to add this option to the parent WebParser measure, but to the child one, which returns the value.
If you did what I've described above, the value is written every time the value of the measure is changing. Usually this isn't an issue, it can be written as often as you want, won't cause any troubles.