The problem is that you have to use the $UserInput$ macro in the context of a bang, or it is just "executed". I really need to use !SetOption, since you can't use IfMatch on [Variables], so since I am setting the String measure anyway, might as well do the test there.
It is currently January 25th, 2021, 7:28 am
Working with InputText
-
- Developer
- Posts: 21470
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Working with InputText
-
- Developer
- Posts: 21470
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Working with InputText
Actually, I like this better...
It's pretty much exactly what I started with, but instead of just using [$UserInput$] in the Command1 option, which would be executed, I just use the macro in the context of a !SetVariable bang that really doesn't do anything but throw the raw input value into a variable that is never used. At the same time the value of [MeasureInput] will be set to the string the user input, and that can be tested right there and then.
I also added IfMatchMode=1, so it doesn't require the test to change from "true" to "false", and added |^$ as another excluded string, so if they hit enter without typing anything, that is ignored.
In any case, now inputting "en-US" does not open the language folder...
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
MyVar=Starting Value
[MeterSearchBox]
Meter=Shape
Shape=Rectangle 1,1,202,25 | Fill Color 215,215,215,255 | Stroke Color 130,130,130,255
W=202
H=25
[MeterSearchLabel]
Meter=String
X=5
Y=5
W=200
H=23
SolidColor=0,0,0,1
FontColor=47,47,47,255
FontSize=12
AntiAlias=1
DynamicVariables=1
StringCase=Upper
Text=#MyVar#
LeftMouseUpAction=[!EnableMeasure MeasureInput][!CommandMeasure "MeasureInput" "ExecuteBatch 1"]
[MeasureInput]
Measure=Plugin
Plugin=InputText
X=5
Y=3
W=197
H=21
SolidColor=200,200,200,255
FontColor=47,47,47,255
FontSize=11
AntiAlias=1
FocusDismiss=1
DynamicVariables=1
Disabled=1
UpdateDivider=-1
IfMatchMode=1
IfMatch=(?i)^jsmorley$|^pul53dr1v3r$|^$
IfMatchAction=[Play error]
IfNotMatchAction=[!SetVariable MyVar "[MeasureInput]"]
Command1=[!SetVariable RawInput "$UserInput$"][!UpdateMeasure MeasureInput]
I also added IfMatchMode=1, so it doesn't require the test to change from "true" to "false", and added |^$ as another excluded string, so if they hit enter without typing anything, that is ignored.
In any case, now inputting "en-US" does not open the language folder...
-
- Posts: 419
- Joined: July 30th, 2014, 10:30 am
Re: Working with InputText
sorry for the confusion. i'm guilty because i sometimes don't think with my head.
Thank you Morley for the solution, it does just the job. i've used the last one.
Thank you ET too and sorry for my, probably a bit rough reply.
I deserve
at best.

Thank you Morley for the solution, it does just the job. i've used the last one.

Thank you ET too and sorry for my, probably a bit rough reply.

I deserve
