Update measure within a command batch

Report bugs with the Rainmeter application and suggest features.
User avatar

Update measure within a command batch

April 20th, 2017, 6:24 pm
Bananorpion
   [30 posts]

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

Re: Update measure within a command batch

April 28th, 2017, 1:41 pm
Bananorpion
   [30 posts]

Nobody has any idea?

Re: Update measure within a command batch

May 24th, 2017, 10:16 am
LGP123
   [35 posts]

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"]

Return to “Bugs & Feature Suggestions”



Who is online

Users browsing this forum: No registered users and 4 guests