It is currently April 24th, 2024, 1:20 am

Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

Hello,
I ahve been tyring some more to RmAPI.Variable() things but again I do not think I am applying that PSRM cmdlet correctly.
The ps1 script:

Code: Select all

function Update {
    
    MakeConfigs
}
function MakeConfigs {
    $activeConfigsRaw=$RmAPI.MeasureStr('GetConfigName')
    $activeConfigs=$activeConfigsRaw -split '\|'

   $string=''
   $i=0

    $activeConfigs | ForEach-Object {
        $string+=@"

[Container$i]
Meter=Shape
MeterStyle=BGStyle
Y=5R
[ConfigBG$i]
Meter=Shape
MeterStyle=BGStyle
Container=Container$i
[Configs$i]
Meter=String
X=209
Y=15r
Text=$_
MeterStyle=Contents
Container=Container$i
DynamicVariables=1
LeftMouseDoubleClickAction=[!EditSkin "$_"][!Update]
"@
        $i++
    }

    $string | Out-File -FilePath "$($RmAPI.VariableStr('@'))Builder.inc" -Encoding utf8

}
My first try did not work but I am curious to how close (or not) I was to doing this.

So I tried this:

Code: Select all

function Update {
    
    MakeConfigs
}
function MakeConfigs {
    $activeConfigsRaw=$RmAPI.MeasureStr('GetConfigName')
    $activeConfigs=$activeConfigsRaw -split '\|'

   $string=''
   $i=0

    $activeConfigs | ForEach-Object {
        $string+=@"

[Container$i]
Meter=Shape
MeterStyle=BGStyle
Y=5R
[ConfigBG$i]
Meter=Shape
MeterStyle=BGStyle
Container=Container$i
[Configs$i]
Meter=String
X=209
Y=15r
Text=$_
MeterStyle=Contents
Container=Container$i
DynamicVariables=1
LeftMouseDoubleClickAction=[!EditSkin "$_"][!Update]
"@
        $i++
        $num=$i
    }

    $string | Out-File -FilePath "$($RmAPI.VariableStr('@'))Builder.inc" -Encoding utf8
    $num  |Out-File ... (bla bad code) "$($RmAPI.Variable('varname')" ... bla 
}
Any help is appreciated.
The PSRM documentation is kind of sparse - is there a one shot deal pdf or something I can use?
Last edited by CodeCode on September 19th, 2021, 10:17 am, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

Ok, I'm still at it.
Tried this, I hope I am getting closer: -----------------(probably not lol)

Code: Select all

function Update {
    
    MakeConfigs
}
function MakeConfigs {
    $activeConfigsRaw=$RmAPI.MeasureStr('GetConfigName')
    $activeConfigs=$activeConfigsRaw -split '\|'

   $string=''
   $i=0

    $activeConfigs | ForEach-Object {
        $string+=@"

[Container$i]
Meter=Shape
MeterStyle=BGStyle
Y=5R
[ConfigBG$i]
Meter=Shape
MeterStyle=BGStyle
Container=Container$i
[Configs$i]
Meter=String
X=209
Y=15r
Text=$_
MeterStyle=Contents
Container=Container$i
DynamicVariables=1
LeftMouseDoubleClickAction=[!EditSkin "$_"][!Update]
[MeasureCount]
Measure=Calc
Formula=$num
DynamicVariables=1
"@
        $i++

    }
    
    $string | Out-File -FilePath "$($RmAPI.VariableStr('@'))Builder.inc" -Encoding utf8
    $num=$i
}
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by death.crafter »

CodeCode wrote: September 19th, 2021, 6:24 am Ok, I'm still at it.
Tried this, I hope I am getting closer: -----------------(probably not lol)

Code: Select all

function Update {
    
    MakeConfigs
}
function MakeConfigs {
    $activeConfigsRaw=$RmAPI.MeasureStr('GetConfigName')
    $activeConfigs=$activeConfigsRaw -split '\|'

   $string=''
   $i=0

    $activeConfigs | ForEach-Object {
        $string+=@"

[Container$i]
Meter=Shape
MeterStyle=BGStyle
Y=5R
[ConfigBG$i]
Meter=Shape
MeterStyle=BGStyle
Container=Container$i
[Configs$i]
Meter=String
X=209
Y=15r
Text=$_
MeterStyle=Contents
Container=Container$i
DynamicVariables=1
LeftMouseDoubleClickAction=[!EditSkin "$_"][!Update]
[MeasureCount]
Measure=Calc
Formula=$num
DynamicVariables=1
"@
        $i++

    }
    
    $string | Out-File -FilePath "$($RmAPI.VariableStr('@'))Builder.inc" -Encoding utf8
    $num=$i
}
You have to point out where things are going wrong.

The script should work fine, attach the current config and I will check it out.
from the Realm of Death
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

Oh everything is working as per the original hopes.

I am trying to get the numerical total of all strings split. That is to say the total number of configs, as an integer or string it doesn't matter since the number will not doing anything other than showing the total configs.
Code's Thingabob_1.1.0.rmskin
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by death.crafter »

CodeCode wrote: September 19th, 2021, 8:00 am Oh everything is working as per the original hopes.

I am trying to get the numerical total of all strings split. That is to say the total number of configs, as an integer or string it doesn't matter since the number will not doing anything other than showing the total configs.

Code's Thingabob_1.1.0.rmskin
It's either $activeConfigs.Count or $activeConfigs.Count-1.

The second one if it has an extra empty object, becuse the raw stri g ends with |
from the Realm of Death
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

Awesome.

Thanks. I was trying various thing. None of them utilised the .Count enumerator.
I would put all of the wrong ways I tried to get the total, but no. That would serve no one.
This is purely something that if I knew about it, since it is similar to [Measure:] in rainmeter script, I might have tried it at least until I got it right.

:bounce:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by death.crafter »

CodeCode wrote: September 19th, 2021, 10:14 am Awesome.

Thanks. I was trying various thing. None of them utilised the .Count enumerator.
I would put all of the wrong ways I tried to get the total, but no. That would serve no one.
This is purely something that if I knew about it, since it is similar to [Measure:] in rainmeter script, I might have tried it at least until I got it right.

:bounce:
It's not an enumerator but a method of the array object but let's not go there.

But a google search might have been of help ;-)
from the Realm of Death
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

death.crafter wrote: September 19th, 2021, 10:48 am But a google search might have been of help ;-)
I googled big time. Never thought to use the word count tho. I also kept bouncing back to the PSRM pages for references, and I also tried to handle the $activeconfigs, but no joy without the ,count of the array objects. all I got the the first container which was always '0'.

Anyway, I am having an OCD moment - or the best version of one...

I was thinking to have an arrow like so; <<<<< point to, and follow the clicked config/s.

My idea is to actually have one already as part of the rows, then unhide the corresponding row with its $i value. So building one more Meter=Image or text not sure which would be the less clunky of the two.
download.png
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by CodeCode »

CodeCode wrote: September 19th, 2021, 1:39 pm Anyway, I am having an OCD moment - or the best version of one...

I was thinking to have an arrow like so; <<<<< point to, and follow the clicked config/s.

My idea is to actually have one already as part of the rows, then unhide the corresponding row with its $i value. So building one more Meter=Image or text not sure which would be the less clunky of the two.

download.png
I do not think this is a good idea rn.

never mind.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Trying More PSRM Things - Return Variable Value/String to Skin Meter/Measure for Text in Skin.

Post by death.crafter »

CodeCode wrote: September 19th, 2021, 2:00 pm I do not think this is a good idea rn.

never mind.
Did you mean a nested menu?

Or just indicator for the last clicked config?
from the Realm of Death