It is currently April 27th, 2024, 3:07 pm

[Solved] InputText not responding as expected

Get help with creating, editing & fixing problems with skins
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

[Solved] InputText not responding as expected

Post by Scolex »

When I enter text in the [File] entry it writes a new string instead of overwriting the old string the other 2 fields overwrite as expected.
OK so I figured out that if you have an equals symbol in the variable name it will right a new string instead of overwriting the existing string.
[MeasureFileKey]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5
Url=http://user:pass@127.0.0.1:52198/MCWS/v1/Playback/Info?Zone=-1
RegExp="(?siU)Name="FileKey">(.*)</Item>"

[MeasureKey]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureFileKey]
StringIndex=1

[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
SolidColor=76A0E8FF
FontColor=FFFFFF
FontFace=Seqoe UI
StringStyle=Italic
FontSize=#FontSize#
X=5
Y=25
H=25
W=240
DefaultValue="Change Me!"

Command1=!RainmeterWriteKeyValue Variables http://user:pass@127.0.0.1:52198/MCWS/v1/File/SetInfo/?=File "$UserInput$" "#CURRENTPATH#Test.inc"
Command2=!RainmeterRefresh InputTextTest
Command3=!RainmeterWriteKeyValue Variables &Field "$UserInput$" "#CURRENTPATH#Test.inc"
Command4=!RainmeterRefresh InputTextTest
Command5=!RainmeterWriteKeyValue Variables &Value "$UserInput$" "#CURRENTPATH#Test.inc"
Command6=!RainmeterRefresh InputTextTest

[File]
Meter=String
X=5
Y=70
FontSize=#FontSize#
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=File
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1-2"

[Field]
Meter=String
X=75R
Y=r
FontSize=#FontSize#
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=Field
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 3-4"

[Value]
Meter=String
X=67R
Y=r
FontSize=#FontSize#
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=Value
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 5-6"

[Key]
MeasureName=MeasureKey
Meter=STRING
X=125
Y=5
StringAlign=Center
FontColor=255,255,255,255
FontSize=#FontSize#
FontFace=Segoe UI
AntiAlias=1
This is what shows in the Text.inc

Code: Select all

[Variables]
http://user:pass@127.0.0.1:52198/MCWS/v1/File/SetInfo/?=File=6543
&Field=Track #
&Value=2
http://user:pass@127.0.0.1:52198/MCWS/v1/File/SetInfo/?=File=4220
Last edited by Scolex on February 20th, 2011, 12:15 am, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: InputText not responding as expected

Post by jsmorley »

The name of a "Key" in a Key=Value pair may NOT contain an equal sign "=". It completely confuses the routines that read .ini files.

If you look at this:

Var=iable=1

Is this Key Var=lable is equal to 1 or Key Var is equal to iable=1
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Solved (tip & ? insid)]InputText not responding as expe

Post by jsmorley »

If you change the = in the URL to %3d it might just fix it, depending on what you are doing with the URL. If you are using it in WebParser, then encoding the equal sign in the URL should work fine.

http://www.tutorialspoint.com/html/html_url_encoding.htm
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: [Solved (tip & ? insid)]InputText not responding as expe

Post by Scolex »

You posted while I was editing.
Your explanation of Why? is perfect.
Thanks
Last edited by Scolex on February 20th, 2011, 12:08 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Solved (tip & ? insid)]InputText not responding as expe

Post by jsmorley »

No, you edited while I was posting... ;-)
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: [Solved] InputText not responding as expected

Post by Scolex »

The plan is to read the text file and reformat it without [variables] and line breaks so I can use it as a command.
Not exactly a graceful way of getting the job done but as long as the end result works I am happy for now as I
can look for an alternative at a later date.