It is currently May 3rd, 2024, 10:50 am

Brackets problem with #CURRENTSECTION#

Get help with creating, editing & fixing problems with skins
User avatar
Active Colors
Moderator
Posts: 1255
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Brackets problem with #CURRENTSECTION#

Post by Active Colors »

Right to the problem:

First case. Works:

Code: Select all

[Rainmeter]
OnRefreshAction=[!SetOptionGroup GrpCell SolidColor "#*CURRENTSECTION*#"]
Second case: Doesn't work:

Code: Select all

[Rainmeter]
OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """["#*CURRENTSECTION*#"]"""]
I think the problem is related to the brackets, I just have nothing else to blame because the first case is working. (Bonus: you can blame me later if you help me to solve the problem).

#*CURRENTSECTION*# refers to:

Code: Select all

[Variables]
TBL_11_TC_C=D:\Documents\Study\
It obviously works if I put #*TBL_11_TC_C*# instead of the #*CURRENTSECTION*#.
User avatar
balala
Rainmeter Sage
Posts: 16195
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Brackets problem with #CURRENTSECTION#

Post by balala »

Maybe this: OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction "[#*CURRENTSECTION*#]"]? Anyway, it's an interesting idea.

EDIT: Sorry, I hurried with reply, it's not a good idea.
User avatar
balala
Rainmeter Sage
Posts: 16195
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Brackets problem with #CURRENTSECTION#

Post by balala »

I found something, but it's not the most elegant: use this: OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """["[TBL_11_TC_C]"]"""] and add the following measure:

Code: Select all

[TBL_11_TC_C]
Measure=String
String=#CURRENTSECTION#
Substitute="#CURRENTSECTION#":"#TBL_11_TC_C#"
The problem is that to LeftMouseUpAction don't have to set TBL_11_TC_C, but #TBL_11_TC_C#. If TBL_11_TC_C is the name of the meter you want to set the LeftMouseUpAction on, then you should set to its LeftMouseUpAction something like #(#CURRENTSECTION#)#, which is practically impossible (I hope, I explained clearly).
User avatar
Active Colors
Moderator
Posts: 1255
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

balala wrote:OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """["[TBL_11_TC_C]"]"""]
I cant have TBL_11_TC_ in the brackets. I have to have there CURRENTSECTION.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Brackets problem with #CURRENTSECTION#

Post by eclectic-tech »

Code: Select all

OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """[#*CURRENTSECTION*#:]"""]
This will set the leftmouseupaction to the current section name (the colon identifies it as a section variable).

But it appears you want that to point to a variable, so balala's point is the final stopper: ##CurrentSection## is not understood by Rainmeter.

Tried section as [meterstring], left-click and windows will say I need an app to open 'meterstring'...

Tried section as [C:\] nothing happens...

Tried section as [#TBL_11_TC_C#] and [TBL_11_TC_C] with variable TBL_11_TC_C=C:\ and neither did anything...

Not sure this will work as you intend using this process...
User avatar
Active Colors
Moderator
Posts: 1255
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

I was trying to get it to work with different methods, but no luck. I will try another approach for my case. Thanks for everybody who tried to help me.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

Out of curiosity, can you post a sample code, please?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Brackets problem with #CURRENTSECTION#

Post by eclectic-tech »

FreeRaider wrote:Out of curiosity, can you post a sample code, please?
I tested with this code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#
OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """[#*CURRENTSECTION*#:]"""]

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=
License=Creative Commons Share-Alike NC 4
Version=

; ========= Variables ==========
[Variables]
TBL_11_TC_C=C:\

; ========= Measures ==========



; ========= Meter Styles ==========



; ========= Meters ==========
[MeterString1]
Meter=String
AntiAlias=1
SolidColor=0,0,0,1
FontColor=255,255,255
Text=Loc 1
LeftMouseUpAction=
Group=GrpCell

[MeterString2]
Meter=String
X=r
Y=1R
AntiAlias=1
SolidColor=0,0,0,1
FontColor=255,255,255
Text=Loc 2
LeftMouseUpAction=
Group=GrpCell

[MeterStrin3]
Meter=String
X=r
Y=1R
AntiAlias=1
SolidColor=0,0,0,1
FontColor=255,255,255
Text=Loc 3
LeftMouseUpAction=
Group=GrpCell
Maybe you can find a way... :confused:
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

There is a "no sense" idea.
Reading Active Colors' first post, it is impossible for #CURRENTSECTION# could refer to [Variables], in my opinion.

Maybe I'm wrong. :confused: :confused:
User avatar
Active Colors
Moderator
Posts: 1255
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

Sample code from my actual skin.

skin.ini

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!SetOptionGroup GrpCell LeftMouseUpAction """["#*CURRENTSECTION*#"]"""][!UpdateMeterGroup GrpCell][!Redraw]

[Variables]
@include=#@#Construction\core.inc
@include2=#@#Settings\timetable.inc

[TBL_11_TC_C]
Meter=Image
MeterStyle=CnsTblCell

[TBL_12_TC_C]
Meter=Image
MeterStyle=CnsTblCell

[TBL_13_TC_C]
Meter=Image
MeterStyle=CnsTblCell
core.inc

Code: Select all

[CnsTblCell]
DynamicVariables=1
UpdateDivider=-1
Group=GrpCell
timetable.inc

Code: Select all

[Variables]
TBL_11_TC_C=D:\
TBL_12_TC_C=D:\Documents
TBL_13_TC_C=D:\Study

Also, in the first post I was a bit wrong about:
Active Colors wrote:First case. Works:

Code: Select all

[Rainmeter]
OnRefreshAction=[!SetOptionGroup GrpCell SolidColor "#*CURRENTSECTION*#"]
This does not work. And it means that it has nothing to do with the brackets as stated above.

Anyways I still have not found an approach using OnRefreshAction.




ASIDE NOTE:
I actually found a working solution using OnUpdateAction in the meterstyle CnsTblCell but it involves double currentsection:

Code: Select all

[CnsTblCell]
OnUpdateAction=[!SetOptionGroup GrpCell LeftMouseUpAction """["##CURRENTSECTION##"]"""]
but I don't want it to be updated every second.




What I really need is to tell every meter from their group to set the leftmouseupaction a variable that called same as section from this group. And it should be done only once per refresh.