Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1056

Help: Rainmeter Skins • Re: Get Output from InputText as Input for RunCommand

$
0
0
I currently have a small widget that allows me to run pwsh commands using the InputText plugin. However, when doing that there is always a window popping up for a quick second. I use the RunCommand plugin for a few of my other Skins (which can run commands completely silent) and I'm wondering if I can make it so that $UserInput$ from the InputText plugin gets executed by the RunCommand plugin instead.
Yep, you need a RunCommand plugin measure indeed. Add it to your code:

Code:

[MeasureRun]Measure=PluginPlugin=RunCommandProgram=PowerShellParameter=#Param#State=HideDynamicVariables=1
This measure uses the #Param# variable as the parameter of PowerShell. This variable has to be set when you enter a value with the InputText plugin. To do this, replace the Command1 option of the [Input] measure by this: Command1=[!SetVariable Param "$UserInput$"][!UpdateMeasure "MeasureRun"][!CommandMeasure "MeasureRun" "Run"]. As you can see, when you enter a value, this is associated with the Param variable, the [MeasureRun] measure is updated and finally is run. Since it is set to run hidden (by the State=Hide option of the [MeasureRun] measure), you see nothing on the screen when run the command.

Statistics: Posted by balala — Yesterday, 7:07 pm



Viewing all articles
Browse latest Browse all 1056

Trending Articles