With the addition of the !SetOption bang we were given a third option for Dynamic Variables. When you use !SetOption it sets Dynamic Variables to “on” for a single update cycle for the targeted section. This can allow us to use Dynamic Variables only when we want to.
While we have had the use of !SetOption for quite some time it wasn’t until somewhat recently that we’ve had very many methods for testing when we want to use it in this fashion.
Let’s take a look at what we’re talking about.
Code: Select all
[Rainmeter]
Update=1000
[MeasureHour]
Measure=Time
Format=%I
OnChangeAction=[!SetOption MeterHour DynamicVariables 0]
[MeterHour]
Meter=String
Text=[MeasureHour]
When you add IfMatch, IfCondition, and IfAbove/Below/Equal to this method you have a very powerful level of control over when to use Dynamic Variables.
In most cases this method won’t make much of a difference. However there is at least one case where it can be a life saver.
Code: Select all
[MeasureWebParser]
Measure=Plugin
Plugin=WebParser
Url=http://somewebsite.com
RegExp=^(.*)$
[MeterString]
Meter=String
MeasureName=MeasureWebParser
ClipString=2
FinishAction=[!SetOption MeterString DynamicVariables 0]
Adding the above line to [MeasureWebParser] easily works around our issue without having to evaluate Dynamic Variables on every single update.
While this method is unnecessary for the majority of authors I hope that a few will find it useful in discovering a solution to their resource hungry skin.