Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1486

Help: Rainmeter Skins • Re: Is OnUnfocusAction behaving properly?

$
0
0
Not sure there is a great solution. If the "case" of the string is not particularly important, then:

Code:

[MeasureString]Measure=StringString=C:\Users\Ernest\Documents\Rainmeter\Substitute="\E":"\e"IfMatch=^\Q[MeasureString]\E$IfMatchAction=[!SetOption MeterString Text "Yes"]DynamicVariables=1
Works, but does change Ernest to ernest.

Might be simpler to go with:

Code:

[MeasureString]Measure=StringString=C:\Users\Ernest\Documents\Rainmeter\IfMatch=[MeasureString:EscapeRegExp]IfMatchAction=[!SetOption MeterString Text "Yes"]DynamicVariables=1
Mmm, I liked the first solution, unfortunately it doesn't work. There's still no match:

Code:

[Test]Measure=StringString=C:\Users\Ernest\Documents\Rainmeter\Substitute="\U":"\u","\E":"\e","\Q":"\q"IfMatch=^\Q[Test]\E$IfMatchAction=[!Log Yes]IfNotMatchAction=[!Log No]
Logs "No". This is because ifMatch is Case sensitive it seems ((?siU) would help there tho). However, it wouldn't help me anyway.

The second solution is not viable either.

What I'm doing is to use your GetActiveTitle to enable\disable HotKey when the skin is\isn't in focus.

Code:

[inFocus]Measure=PluginPlugin=GetActiveTitleIfMatch=^\Q#CURRENTPATH##CURRENTFILE#\E$IfMatchAction=[!CommandMeasure HKUP Start][!CommandMeasure HKDown Start]IfNotMatchAction=[!CommandMeasure HKUP Stop][!CommandMeasure HKDown Stop]IfMatchMode=1
Since the ifMatch is not using a value from a measure, but from built-in variables, the substitute wouldn't actually change anything, the problem is in the ifMatch itself. So I guess the only solution here is to create a measure to read #CURRENTPATH##CURRENTFILE# and then use the string value of that measure along with EscapeRegExp.

Something like:

Code:

[SkinPath]Measure=StringString=#CURRENTPATH##CURRENTFILE#[isActive]Measure=PluginPlugin=GetActiveTitleIfMatch=^[SkinPath:EscapeRegExp]$IfMatchAction=[!CommandMeasure HKUP Start][!CommandMeasure HKDown Start]IfNotMatchAction=[!CommandMeasure HKUP Stop][!CommandMeasure HKDown Stop]IfMatchMode=1

Statistics: Posted by RicardoTM — 54 minutes ago



Viewing all articles
Browse latest Browse all 1486

Trending Articles