It is currently April 24th, 2024, 1:58 pm
Get help with creating, editing & fixing problems with skins
GyRoZz
Posts: 5 Joined: May 7th, 2018, 1:18 pm
Post
by GyRoZz » July 27th, 2018, 7:47 pm
Hey,
I am trying to write a user input to multiple variables, but I can't get it to work.
This is the code:
Code: Select all
[MeasureInputAngleGrad]
Measure=Plugin
Plugin=InputText
SolidColor=eeeeee
FontColor=111111
FontFace=Quicksand Light
FontSize=14
X=160
Y=299
H=29
W=150
StringAlign=Center
DefaultValue="#SomeVariable1#"
DynamicVariables=1
Command1=[!WriteKeyValue Variables SomeVariable1 "$UserInput$" "individual.inc"][!WriteKeyValue Variables SomeVariable2 "$UserInput$" "individual.inc"][!Refresh "Variety Apps\Test" "Test.ini"][!Refresh]
[SetAngleGrad]
Meter=String
X=235
Y=295
H=30
W=150
FontSize=15
SolidColor=eeeeee
AntiAlias=1
LeftMouseUpAction=[!CommandMeasure "MeasureInputAngleGrad" "ExecuteBatch 1"]
Group=Background
Hidden=#ShowBgGrad#
FontFace=Quicksand
FontColor=111111
Text=#SomeVariable1#
StringAlign=Center
Padding=0,5,0,0
But what I get with this code if I for example give an input of '45' is the following:
Code: Select all
[Variables]
SomeVariable1=45
SomeVariable2=$UserInput$
Does anyone know how to make this work?
Last edited by GyRoZz on July 28th, 2018, 6:45 pm, edited 1 time in total.
eclectic-tech
Rainmeter Sage
Posts: 5406 Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Post
by eclectic-tech » July 27th, 2018, 10:36 pm
This was discussed in another thread; the first time "$UserInput$" is used the value of the measure is set to that value, so to use the same "$UserInput$" multiple times, use the measure value of "[#CurrentSection#]".
Code: Select all
Command1=[!WriteKeyValue Variables SomeVariable1 "$UserInput$" "individual.inc"][!WriteKeyValue Variables SomeVariable2 "[#CurrentSection#]" "individual.inc"][!Refresh "Variety Apps\Test" "Test.ini"][!Refresh]
jsmorley
Developer
Posts: 22629 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » July 28th, 2018, 2:14 am
Minor thing...
Even though it works, I'm a little leery of suggesting nesting variables without using the nesting syntax.
https://docs.rainmeter.net/manual/variables/nesting-variables/
For
[#CurrentSection#]
I'd prefer
[&[#CurrentSection]]
I just think it encourages thinking that you can nest variables and section variables without it, and this particular case is one of the few cases where it works.
eclectic-tech
Rainmeter Sage
Posts: 5406 Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Post
by eclectic-tech » July 28th, 2018, 2:17 am
jsmorley wrote: Minor thing...
Even though it works, I'm a little leery of suggesting nesting variables without using the nesting syntax.
https://docs.rainmeter.net/manual/variables/nesting-variables/
For
[#CurrentSection#]
I'd prefer
[&[#CurrentSection]]
I just think it encourages thinking that you can nest variables and section variables without it, and this particular case is one of the few cases where it works.
Good point... old habits die hard!
GyRoZz
Posts: 5 Joined: May 7th, 2018, 1:18 pm
Post
by GyRoZz » July 28th, 2018, 6:44 pm
Ah great, works like a charm! Thanks eclectic-tech and jsmorley!