It is currently March 28th, 2024, 11:30 am

Update measure within a command batch

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
Bananorpion
Posts: 40
Joined: April 16th, 2017, 8:35 pm

Update measure within a command batch

Post by Bananorpion »

Yop.

Here's the "bug" I met: I created a File Explorer skin, using mostly Fileview plugin, as well as Webparser. At some point, I'm using a measure to find a path in another file, to set the new path on the current skin. But I can't do it all within a single command.
More clear with the code, I think (I removed anything unrelated with the bug, it won't work like this of course. To test it, it is featured there, as Explorer 2 skin):

Code: Select all

[MeasurePath]
Measure=Plugin
Plugin=FileView
FinishAction=[!WriteKeyValue #CURRENTSECTION# Path "[MeasurePath]"][!Update]

[MeasureExplorer1Path]
Measure=Plugin
Plugin=WebParser
URL="file://#ROOTCONFIGPATH#Explorer 1\Explorer 1.ini"

[MeasureExplorer1PathChild]
Measure=Plugin
Plugin=WebParser
URL=[MeasureExplorer1Path]
StringIndex=1

[MeterTitle]
Meter=STRING
MouseScrollUpAction=[!WriteKeyValue MeasurePath Path "[MeasureExplorer1PathChild]"][!Refresh]
MouseScrollDownAction=[!CommandMeasure MeasureExplorer1Path Update][[!CommandMeasure MeasureExplorer1PathChild Update]]

Here, it works: the scroll down updates the necessary values, and the scroll up writes the new value. But if I try to do the whole thing within a single command, it does not work, because (I guess, I haven't looked into the source code 'cause C++ scares me) the whole batch of command is already prepared before the measures update, so the command, even after the measures update, still uses the former value. So, is there a workaround? So I can do something like

Code: Select all

MouseScrollUpAction=[!CommandMeasure MeasureExplorer1Path Update][[!CommandMeasure MeasureExplorer1PathChild Update]][!WriteKeyValue MeasurePath Path "[MeasureExplorer1PathChild]"][!Refresh]
User avatar
Bananorpion
Posts: 40
Joined: April 16th, 2017, 8:35 pm

Re: Update measure within a command batch

Post by Bananorpion »

Nobody has any idea?
User avatar
LGP123
Posts: 60
Joined: November 5th, 2016, 12:15 pm

Re: Update measure within a command batch

Post by LGP123 »

Maybe you can try to add a measure that can wait for 1 cycle update and then execute your bangs.
Something like this :

Code: Select all

[MeasureWait]
Measure=Calc
Formula=0                   ;and maybe this line is not even necessary.
OnChangeAction={bangs}[!SetOption "#CURRENTSECTION#" "Formula" "0"][!Update]
;the !update bang can also not be necessary if you are not in Update=-1
And then to activate your bangs just use [!SetOption "MeasureWait" "Formula" "1"]
Post Reply