_3D_ wrote: ↑August 19th, 2020, 3:47 pmWhen it reads the variable from the file, it shows the #@# variable as a literal path, as can be seen in the image.
I was expecting the text to be displayed as:
Instead of:
Code: Select all
C:\`Custom\Apps\Rainmeter\Skins\RainTask\@Resources\Scripts\FF_Left_Window.exe
I'm guessing the issue is perhaps with the nested variable, or maybe I need to use a 'Substitute' line somewhere, I did try adding this line to the meter:
I was hoping the escape would perhaps make it more literal since that trick worked another config, but it was just a rough guess and didn't work, also i have no clues on how Rainmeter resolve these paths, any input would greatly appreciated.
The substitute you're looking for is (this can be further refined, if needed):
Code: Select all
RegExpSubstitute=1
Substitute="^.*@Resources\\":"#*@*#"
but it has to be applied on
measures, and
not meters (like you attempted to).
Now on the issue itself, this happens because variables are resolved
at skin load or refresh, see
here, so once you input that
#@# variable unescaped, it will be replaced with the actual path no matter what, simply because that replacement happens before anything else does. In other words, the only 2 solutions I see for this is either:
- input the variable in the escaped form
- use the above substitute in the measure that gets that variable mix you have
EDIT: Just noticed your nesting is not quite appropriate, so here is a code sample (substitution variant):
Code: Select all
[Variables]
B8_4_LMD=#@#Scripts\FF_Left_Window.exe
ButtonN=4
MouseButton=LMD
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[MeasureTest]
Measure=String
String=[#B8_[#ButtonN]_[#MouseButton]]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.*@Resources\\":"#*@*#"
---Meters---
[MeterTest]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureTest
Text="%1"
or, the
#@# escaping variant (no measure manipulating the string afterwards needed):
Code: Select all
[Variables]
B8_4_LMD=#*@*#Scripts\FF_Left_Window.exe
ButtonN=4
MouseButton=LMD
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Meters---
[MeterTest]
Meter=STRING
X=0
Y=0
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="[#B8_[#ButtonN]_[#MouseButton]]"
If your code after integration requires it, you can of course add
DynamicVariables=1 where needed. In my sample, it wasn't.