If I try to search for "3+5" in Google with a rainmeter skin, I'll get results for "3 5" instead. I could easily fix that by substituting it with "%2B" (according to this list), but tacking a Substitute option on the end of the measure doesn't really work as well as it should.
So is it possible to do what I'm trying to do here? If not, is there any other way to fix the problem that I'm having (other than by just typing "3 plus 5" and ignoring it)?
It is currently May 1st, 2024, 10:27 am
Substitution with InputText.dll
-
- Posts: 9
- Joined: September 1st, 2012, 10:44 pm
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Substitution with InputText.dll
Frankly, the easiest way to do this would be to set the input as a variable, then use a Lua script to substitute the "+" sign and send the actual search command. For example, you can use an InputText command like this:
Then make a new script measure:
And the script:
Code: Select all
Command1=[!SetVariable "SearchInput" "$UserInput$"][!CommandMeasure "SearchScript" "Search()"]
Code: Select all
[SearchScript]
Measure=Script
ScriptFile=Search.lua
Code: Select all
function Search()
local SearchInput = SKIN:GetVariable('SearchInput')
SearchInput = SearchInput:gsub('+', '%%2B')
SKIN:Bang('"http://www.google.com/search?q='..SearchInput..'"')
end
-
- Posts: 9
- Joined: September 1st, 2012, 10:44 pm
Re: Substitution with InputText.dll
Whoa, that worked perfectly! Thanks!Kaelri wrote:-stuff-