We have added a new action command to Measures:
OnChangeAction
This allows you to define an action to be taken when the value of a measure changes.
The initial change from "nothing" to a value when the skin is loaded or refreshed is ignored.
Note: With plugins that are "threaded", which includes WebParser and FileView today, the action will fire on the first change when loading or refreshing the skin. This will likely change in the near future.
It is currently April 24th, 2024, 11:50 pm
OnChangeAction Added
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
-
- Posts: 329
- Joined: June 9th, 2011, 6:46 pm
Re: OnChangeAction Added
Rainmeter - You are only limited by your imagination and creativity.
-
- Posts: 17
- Joined: January 16th, 2015, 5:51 am
Re: OnChangeAction Added
Hey, I was looking for this, but I couldn't find it anywhere. Is there a way to pass the value of the change to the script that I call?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: OnChangeAction Added
[SomeMeasure]snyderxc wrote:Hey, I was looking for this, but I couldn't find it anywhere. Is there a way to pass the value of the change to the script that I call?
Measure=Whatever
OnChangeAction=[!CommandMeasure ScriptMeasureName """ScriptFunctionName("[SomeMeasure]")"""]
DynamicVariables=1
All the magic quotes / quotes are needed to ensure it works with a Lua function that wants a "string" as an argument. Might be able to simplify it a bit if you just passing a number value to a number Lua function:
[SomeMeasure]
Measure=Whatever
OnChangeAction=[!CommandMeasure ScriptMeasureName "ScriptFunctionName([SomeMeasure])"]
DynamicVariables=1
-
- Posts: 17
- Joined: January 16th, 2015, 5:51 am
Re: OnChangeAction Added
Ok, great! I'll try it (though I'm using Python, but we'll see!)
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: OnChangeAction Added
No, that has nothing to do with any external script.snyderxc wrote:Ok, great! I'll try it (though I'm using Python, but we'll see!)
To execute something external, just use:
OnChangeAction=["PathAndCommandToExecute" "[SomeMeasure]"]
DynamicVariables=1