It is currently June 16th, 2024, 12:42 pm

LUA GetOption() - How to preserve variable references?

Discuss the use of Lua in Script measures.
User avatar
Yincognito
Rainmeter Sage
Posts: 7433
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: LUA GetOption() - How to preserve variable references?

Post by Yincognito »

Crest wrote: May 22nd, 2024, 12:10 am I tried this with a string measure but wasn't sure what you meant in terms of your comment about storing the variables as section variables. As-is with that boolean enabled the best I'm finding it can do with disabling parsing is just regular section vars like :W and such (expectedly, given the description), while the rest get parsed (including variables that themselves reference section vars).
What Jeff meant was using an equivalent measure (example posted by him above) instead of a variable in the option that's retrieved by calling GetOption() from Lua, since the former should be treated as literal if setting the bReplaceMeasures parameter to false. In other words, the parameter should work with measures existing in the option string, but won't work with variables. Obviously, this refers to the OP, your scenario might aim for different things.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Crest
Posts: 139
Joined: August 16th, 2013, 12:47 pm

Re: LUA GetOption() - How to preserve variable references?

Post by Crest »

I see; replacing all variables with string measures serving the same purpose and manipulating those instead. Would require quite a bit of reworking but makes sense and a decent option.
User avatar
Yincognito
Rainmeter Sage
Posts: 7433
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: LUA GetOption() - How to preserve variable references?

Post by Yincognito »

Crest wrote: May 22nd, 2024, 11:08 am I see; replacing all variables with string measures serving the same purpose and manipulating those instead. Would require quite a bit of reworking but makes sense and a decent option.
Do a few simple tests, choose the most comfortable approach for you, then implement it, if you didn't do that already, and all will be fine. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth