As I said in my first reply, a such skin could work even without a lua script. Here is a such solution. I removed the [SearchScript] script measure, which isn't needed any more.
Beside this, I also added the following measure:
Code: Select all
[MeasureSearch]
Measure=String
String=#SearchInput#
RegExpSubstitute=1
Substitute="\s+":"+"
DynamicVariables=1
OnChangeAction=["https://www.facebook.com/search/#Category#/?q=[MeasureSearch]"]
When this measure is updated AND its value is changing, it'll open the set URL, in the default browser. In this URL I've used the Category variable (which is set by some !SetVariable bangs, see below) and the value returned by the [MeasureSearch] measure itself. This value is similar with the string typed into the search box, but the spaces are replaced by
+ sign(s).
Now replace the Command1 option of the [WhereToSearch] measure, to not run the nonexistent script measure, but to update instead the [MeasureSerach] measure:
Command1=[!SetVariable "SearchInput" "$UserInput$"][!UpdateMeasure "MeasureSearch"]. This way when you enter a string into the search box and hit enter, the !SetVariable bang will set the value of the SearchInput variable, which will be taken by the [MeasureSearch] measure, the appropriate substitutions will be made and the updated URL will be executed.
Now one more: refreshing a skin is a usually undesired operation:
https://forum.rainmeter.net/viewtopic.php?p=119966#p119966
You've used !WriteKeyValue bangs, along with !Refresh bangs in each LeftMouseUpAction option of the [Top], [Pages], [People], [Photos], [Videos] and [Groups] meters. I also rewrote these options:
Code: Select all
[Top]
...
LeftMouseUpAction=[!SetVariable SelectedXA "60"][!SetVariable SelectedXB "19"][!SetVariable SelectedYA "116"][!SetVariable SelectedYB "19"][!SetVariable Category "top"][!UpdateMeter "Selection"][!Redraw]
[Pages]
...
LeftMouseUpAction=[!SetVariable SelectedXA "116"][!SetVariable SelectedXB "19"][!SetVariable SelectedYA "172"][!SetVariable SelectedYB "19"][!SetVariable Category "pages"][!UpdateMeter "Selection"][!Redraw]
[People]
...
LeftMouseUpAction=[!SetVariable SelectedXA "172"][!SetVariable SelectedXB "19"][!SetVariable SelectedYA "228"][!SetVariable SelectedYB "19"][!SetVariable Category "people"][!UpdateMeter "Selection"][!Redraw]
[Photos]
...
LeftMouseUpAction=[!SetVariable SelectedXA "60"][!SetVariable SelectedXB "73"][!SetVariable SelectedYA "116"][!SetVariable SelectedYB "73"][!SetVariable Category "photos"][!UpdateMeter "Selection"][!Redraw]
[Videos]
...
LeftMouseUpAction=[!SetVariable SelectedXA "116"][!SetVariable SelectedXB "73"][!SetVariable SelectedYA "172"][!SetVariable SelectedYB "73"][!SetVariable Category "videos"][!UpdateMeter "Selection"][!Redraw]
[Groups]
...
LeftMouseUpAction=[!SetVariable SelectedXA "172"][!SetVariable SelectedXB "73"][!SetVariable SelectedYA "228"][!SetVariable SelectedYB "73"][!SetVariable Category "groups"][!UpdateMeter "Selection"][!Redraw]
This way there's no need to always refresh the skin, when you click a new search category. But this solution will work, only if you add the
DynamicVariables=1 option to the [Selection] meter, where the variables are used.
If you want to also write the newly set values of the variables into the
@Resources\Variables.ini file, you just have to add back the appropriate !WriteKeyValue bangs, to each of the above LeftMouseUpAction options,
without the [!Refresh] bangs!
Obviously if you follow these changes, you also can remove the Search.lua file from the config, because it's not needed any more.