If the string value of MyVar is "en-US" then that is executed as a run command in Windows. In Windows, if you execute en-US at a command prompt, you get that language folder opened in Explorer. I wasn't aware of that, but nothing in Windows really surprises me anymore.
Not sure what you can do about that, since you are just executing whatever the user types in. That could be anything, including cmd commands that could have very unfortunate results. I don't really understand why you would have a Rainmeter skin that attempts to be a command line replacement. I just don't agree with using Rainmeter this way.
jsmorley wrote: ↑December 5th, 2019, 7:00 pm
The issue is with:
IfNotMatchAction=["#MyVar#"]
If the string value of MyVar is "en-US" then that is executed as a run command in Windows. In Windows, if you execute en-US at a command prompt, you get that language folder opened in Explorer. I wasn't aware of that, but nothing in Windows really surprises me anymore.
Not sure what you can do about that, since you are just executing whatever the user types in. That could be anything, including cmd commands that could have very unfortunate results. I don't really understand why you would have a Rainmeter skin that attempts to be a command line replacement. I just don't agree with using Rainmeter this way.
But, to each his own...
no Morley, i don't want it at all. I want to enter any language tag without opening the folders. ET's solution solves it if a tag is forbidden in the code. i'd also like to get rid of it if a tag isn't forbidden. So, i DON'T WANT cmd to be executed.
@ jsmorley Yes, I was also surprised that that input opened the associated language folder... Windows can be too smart for it's own good.
Pul53dr1v3r wrote: ↑December 5th, 2019, 7:11 pm
no Morley, i don't want it at all. I want to enter any language tag without opening the folders. ET's solution solves it if a tag is forbidden in the code. i'd also like to get rid of it if a tag isn't forbidden. So, i DON'T WANT cmd to be executed.
Looking at your code, I don't understand why you want to execute the $UserInput$ anyway; normally the result is set as a variable value or written for use later after a refresh.
To eliminate the folder opening just remove the execution command from IfNotMatchAction=["#MyVar#"][Bang][Bang]
becomes IfNotMatchAction=[Bang][Bang]
eclectic-tech wrote: ↑December 5th, 2019, 7:28 pm
To eliminate the folder opening just remove the execution command from IfNotMatchAction=["#MyVar#"][Bang][Bang]
Do you see it in any previous post about this issue? i don't. i also didn't know what's the use of it, to be honest because i didn't add it.
So, who muddied the waters?
I guess I did, in my original suggested code. Let me chew on how to avoid having what is typed in "executed".
Edit: I guess you never want to just use [$UserInput$] in a Command[n] option in InputText, as that will do two unavoidable things. First, set the value of the InputText measure to whatever is typed in, and second, attempt to execute whatever is typed in. I think you always want to use $UserInput$ in the context of some bang, !SetOption, !SetVariable, !WriteKeyValue, whatever.
So you use !SetOption to pass the value captured in $UserInput$ to a String measure, then do the IfMatch evaluation there and take whatever actions you want.
jsmorley wrote: ↑December 5th, 2019, 9:32 pm
Note that I have to hammer the String measure with !DisableMeasure and !EnableMeasure to force the IfMatch to be evaluated each time, even if the result doesn't change from "true" to "false".
Just use IfMatchMode = 1.
I haven't looked into it but doesn't the inputtext plugin store the last value it had, so you'd be able to do IfMatch just right on the input textplugin instead?
Yamajac wrote: ↑December 5th, 2019, 9:38 pm
Just use IfMatchMode = 1.
I haven't looked into it but doesn't the inputtext plugin store the last value it had, so you'd be able to do IfMatch just right on the input textplugin instead?
Yeah, I edited my post just before you posted... I was afraid it might run-away with beeps, but the UpdateDivider=-1 takes care of that.
jsmorley wrote: ↑December 5th, 2019, 9:40 pm
Yeah, I edited my post just before you posted... I was afraid it might run-away with beeps, but the UpdateDivider=-1 takes care of that.