I have this section of code in my rainmeter script:I want to change this script so that the $UserInput$ area adds url encoding to it. That way, if I type something like # into the search box, instead of going to http://www.google.com/search?q=# and redirecting me to http://www.google.com/webp, it goes to http://www.google.com/search?q=%23Code:
Command1=!Execute ["http://www.google.com/search?q=$UserInput$"] DefaultValue=""
Code:
[Rainmeter]Update=1000AccurateText=1[MeterSearchBox]Meter=ShapeShape=Rectangle 1,1,202,25 | Fill Color 215,215,215,255 | Stroke Color 130,130,130,255W=202H=25LeftMouseUpAction=[!CommandMeasure "MeasureSearchInput" "ExecuteBatch 1-2"][MeasureSearchInput]Measure=PluginPlugin=InputTextX=3Y=2W=200H=22SolidColor=200,200,200,255FontColor=47,47,47,255FontSize=11AntiAlias=1FocusDismiss=1DynamicVariables=1Command1=$UserInput$Command2=["https://www.google.com/search?q=[MeasureSearchInput:EncodeURL]"]
https://docs.rainmeter.net/manual/variables/section-variables/#EncodeURL
Notes:
Do not use !Execute it was deprecated years ago.
I highly recommend against using http://. Use https:// Unless you want every hacker out there to see your searches for Naked Midget Wrestling.
Statistics: Posted by jsmorley — Today, 3:45 am