It is currently December 3rd, 2022, 12:11 pm

IfMatch statement

Get help with creating, editing & fixing problems with skins
User avatar
Jaime Méndez
Posts: 91
Joined: August 31st, 2022, 10:00 pm

IfMatch statement

Post by Jaime Méndez »

Hi!

Please, if someone can help.

I am just about to release final skin version, but there is still one issue.
I don't find a way to have "LeftMouseUpAction" within an "IfMatchAction" statement

Here is the pise of code involved and the whole skin:
https://forum.rainmeter.net/viewtopic.php?p=211224#p211224

Thank you fellows!
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: IfMatch statement

Post by SilverAzide »

Jaime Méndez wrote: November 17th, 2022, 4:11 pm Hi!

Please, if someone can help.

I am just about to release final skin version, but there is still one issue.
I don't find a way to have "LeftMouseUpAction" within an "IfMatchAction" statement

Here is the pise of code involved and the whole skin:
https://forum.rainmeter.net/viewtopic.php?p=211224#p211224

Thank you fellows!
There's nothing wrong with the IfMatch. What's wrong is that your !SetOption commands in the actions are completely mangled. Your triple-quotes are unbalanced (and may be unneeded) and your usage of asterisks is not correct either. I'd suggest reviewing the docs on how to escape variables and section references.
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfMatch statement

Post by balala »

SilverAzide wrote: November 17th, 2022, 6:39 pm Your triple-quotes are unbalanced (and may be unneeded)
In fact, only one single pair of triple-quote can be used into one bang. If there are more, the value which will be set is from the first triple-quote up to the next one. All rest is ignored. This is what I described in my last reply, posted in the appropriate topic.
User avatar
Jaime Méndez
Posts: 91
Joined: August 31st, 2022, 10:00 pm

Re: IfMatch statement

Post by Jaime Méndez »

Ok. Now it is working, but only for the first file or folder icon (second tile in row)

Code: Select all

IfMatch=^$
IfMatchAction=[!SetOption MeterTileSelection%% LeftMouseUpAction """[!CommandMeasure mFilePath%% "FollowPath"][!SetVariable Path "[*mPath*]"][!UpdateMeasure mPath][!CommandMeasure "ScriptFactoryTiles" "Run((#*Amount*#-1))"][!CommandMeasure "ScriptRefresher" "Run()"][!Refresh]"""]
IfNotMatchAction=[!SetOption MeterTileSelection%% LeftMouseUpAction """[!CommandMeasure mFilePath%% "FollowPath"]"""]
"leftmouseupclick" on next tiles does nothing. I have checked "#@#include\tile.inc" file and it has been built ok. I should work

From index 1 to 19, all have been built on file

Code: Select all

IfMatch=^$
IfMatchAction=[!SetOption MeterTileSelection2 LeftMouseUpAction """[!CommandMeasure mFilePath2 "FollowPath"][!SetVariable Path "[*mPath*]"][!UpdateMeasure mPath][!CommandMeasure "ScriptFactoryTiles" "Run((#*Amount*#-1))"][!CommandMeasure "ScriptRefresher" "Run()"][!Refresh]"""]
IfNotMatchAction=[!SetOption MeterTileSelection2 LeftMouseUpAction """[!CommandMeasure mFilePath2 "FollowPath"]"""]
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfMatch statement

Post by balala »

Jaime Méndez wrote: November 17th, 2022, 8:03 pm From index 1 to 19, all have been built on file
On which measures have you added those IfMatch options?
User avatar
Jaime Méndez
Posts: 91
Joined: August 31st, 2022, 10:00 pm

Re: IfMatch statement

Post by Jaime Méndez »

balala wrote: November 17th, 2022, 8:18 pm On which measures have you added those IfMatch options?
There is a lua script that generates the "tiles.inc" using "tiles.inc.template" file in "include" folder. You don´t need to check over the lua script, you just need to see how tile.inc is rendering tiles in skin. What i see is that it should be working for all folder and file tiles :???:
Last edited by Jaime Méndez on November 17th, 2022, 11:27 pm, edited 1 time in total.
User avatar
Jaime Méndez
Posts: 91
Joined: August 31st, 2022, 10:00 pm

Re: IfMatch statement

Post by Jaime Méndez »

I found the error!

There was a "%%" missing in measure name in "tiles.inc.template"

Measure name

Code: Select all

[MeasureFileSize]
should contain "%%" anywhere in its name

Code: Select all

[MeasureFileSize%%]
so the whole measure section repeats any times needed until 19 to acompain meter to be set with "IfMatchAction" "!SetOption" instruction

Code: Select all

[MeasureFileSize%%]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Index=%%
Type=FileSize
IfMatch=^$
IfMatchAction=[!SetOption MeterTileSelection%% LeftMouseUpAction """[!CommandMeasure mFilePath%% "FollowPath"][!SetVariable Path "[*mPath*]"][!UpdateMeasure mPath][!CommandMeasure "ScriptFactoryTiles" "Run((#*Amount*#-1))"][!CommandMeasure "ScriptRefresher" "Run()"][!Refresh]"""]
IfNotMatchAction=[!SetOption MeterTileSelection%% LeftMouseUpAction """[!CommandMeasure mFilePath%% "FollowPath"]"""]
It is working as a charm now!

Thankyou again guys! :beer: I debt you a beer

Posting it now!
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfMatch statement

Post by balala »

Jaime Méndez wrote: November 17th, 2022, 11:26 pm It is working as a charm now!
Glad you got it working.
But what you mean by Index=%% on the [MeasureFileSize%%] measure?
User avatar
Jaime Méndez
Posts: 91
Joined: August 31st, 2022, 10:00 pm

Re: IfMatch statement

Post by Jaime Méndez »

This text chain "%%" is present only in a template file that isn't really part of skin structure, but it is needed for a "lua" script file that generates the real final "inc" file that form part of the skin. Script substitutes "%%" for a index number "n" times, so measures and meters repeat indexed "n" times in final "inc" file.
I hope I made myself clear
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfMatch statement

Post by balala »

Jaime Méndez wrote: November 18th, 2022, 10:02 pm I hope I made myself clear
Yep, you did.