Let's say we have a variable SomeVar which has a value of `[&Script:Manip('#Foo#')],(50+10)`. For the sake of this example let's say the `Manip` function returned a color value and the latter was an alpha value.
If one uses say `[LeftMouseDownAction=[&Script:Func('SomeVar')]` one can then within the Lua use `SKIN:GetVariable(var)` to obtain the variable value.
This will output the raw unparsed variable value. So if the variable itself contains script functions those will be reproduced verbatim in the returned value. The upside is the script gets passed the variable name name so it can use that for lookups.
OTOH one can use the `#SomeVar#` syntax to pass to the script instead, which will return a semi-parsed value instead of the variable name itself. Following the example let's say it returned `200,200,200,(50+10)`. The script part gets parsed but the formula part is left as-is.
Alternatively if a meter happens to have just the desired value for one of its options one can pass the meter name and option name to the script and then use (eg) `myMeter = SKIN:GetMeter(name)` and then `myMeter:GetOption(option)` to obtain the parsed version of the option value. However (at least for FontColor which I tested) oddly this doesn't return the formula part ime, so following the example this only returns `200,200,200` and the alpha isn't returned (in any form), despite the actual rendered value having alpha in Rainmeter.
Is there any way to pass to or obtain via Lua a fully parsed variable value with formulas parsed as well? Or is some internal order of execution preventing that?
If one uses say `[LeftMouseDownAction=[&Script:Func('SomeVar')]` one can then within the Lua use `SKIN:GetVariable(var)` to obtain the variable value.
This will output the raw unparsed variable value. So if the variable itself contains script functions those will be reproduced verbatim in the returned value. The upside is the script gets passed the variable name name so it can use that for lookups.
OTOH one can use the `#SomeVar#` syntax to pass to the script instead, which will return a semi-parsed value instead of the variable name itself. Following the example let's say it returned `200,200,200,(50+10)`. The script part gets parsed but the formula part is left as-is.
Alternatively if a meter happens to have just the desired value for one of its options one can pass the meter name and option name to the script and then use (eg) `myMeter = SKIN:GetMeter(name)` and then `myMeter:GetOption(option)` to obtain the parsed version of the option value. However (at least for FontColor which I tested) oddly this doesn't return the formula part ime, so following the example this only returns `200,200,200` and the alpha isn't returned (in any form), despite the actual rendered value having alpha in Rainmeter.
Is there any way to pass to or obtain via Lua a fully parsed variable value with formulas parsed as well? Or is some internal order of execution preventing that?
Statistics: Posted by Crest — Today, 3:39 am — Replies 2 — Views 39