OnChangeAction Added

Changes made during the Rainmeter 2.5 beta cycle and earlier.
User avatar

OnChangeAction Added

January 13th, 2013, 4:39 pm
jsmorley
Developer   [17826 posts]

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.
User avatar

Re: OnChangeAction Added

January 15th, 2013, 4:02 pm
AlC
   [331 posts]

Re: OnChangeAction Added

February 19th, 2015, 3:44 pm
snyderxc
   [17 posts]

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?
User avatar

Re: OnChangeAction Added

February 19th, 2015, 3:56 pm
jsmorley
Developer   [17826 posts]

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?


[SomeMeasure]
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

Re: OnChangeAction Added

February 19th, 2015, 6:29 pm
snyderxc
   [17 posts]

Ok, great! I'll try it (though I'm using Python, but we'll see!)
User avatar

Re: OnChangeAction Added

February 19th, 2015, 6:32 pm
jsmorley
Developer   [17826 posts]

snyderxc wrote:Ok, great! I'll try it (though I'm using Python, but we'll see!)


No, that has nothing to do with any external script.

To execute something external, just use:

OnChangeAction=["PathAndCommandToExecute" "[SomeMeasure]"]
DynamicVariables=1

Return to “Rainmeter 2.5”



Who is online

Users browsing this forum: No registered users and 1 guest