It is currently April 23rd, 2024, 6:59 pm

[solved] Having Trouble With Variables Being Used To Write To Another Variable

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by balala »

CodeCode wrote: December 13th, 2021, 1:12 pm If there is actually a way this can work. Eventually the buttons will only appear once they have a set value.
But again I think this is really not a job for only rainmeter script. I feel certain lua could do it. So I think I might abandon the idea, under the premise that someone who does know lua would have to write that code for me, and I am not really expecting that - aT ALL.

So, I think I will take a few more jabs at this, but if it simply is too sloppy - I'll just dump the idea. :Whistle
It is extremely hard to follow this way what's going on with those variables. I think would be helpful to us to have the whole code, not just snippets. So please post it. Additionally if there are too many resources involved (such as images, included .inc files or anything else) please pack the config and upload here the package.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by death.crafter »

Quoting Yinco, https://forum.rainmeter.net/viewtopic.php?t=39058&start=10#p200985

FavList_1.rmskin
It's easy to use and expandable.
Btw, I got into Uni and can't find much time for the forums. I hope I can find some time to spend here more often.
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

balala wrote: December 13th, 2021, 2:58 pm It is extremely hard to follow this way what's going on with those variables. I think would be helpful to us to have the whole code, not just snippets. So please post it. Additionally if there are too many resources involved (such as images, included .inc files or anything else) please pack the config and upload here the package.
It isnt really involved, that way but it is really complicated.
Searching for keywords 'favourite' or 'faveone, favetwo' should get you quickly to the bits where this latest code is.
Titan Drives_v.v.1.rmskin
It's easy to use and expandable.
Btw, I got into Uni and can't find much time for the forums. I hope I can find some time to spend here more often.
[/quote]

Thanks d.c I'll have a look.
Good luck at university. :thumbup:
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

I am making slow progress.
TBH I haven't been really on this, due to job commitments.

I have a circumstance with making thing behave.
The issue is when I am setting a Variable using SetVariable and WriteKeyValue. Maybe just one or maybe both.
When setting the value with those bangs, I am getting an anomalous backslash "\". I don't know how to substitute it it for an empty string. The catch is it cannot be for every instance of a back slash, which I would just do that basic substitute. I has to be only after the string "THIS PC\". Now that I have typed through this, I might have realised how, so I'll try those ideas, whilst waiting for something definitively correct.
Cheers.

EDIT:
Ok. I trued this: Substitute="THIS PC\":"THIS PC". Unfortunately the expectation was for the substitute to allow FileView to navigate to the THIS PC level of the directory tree, though it does not seem to work that way...

Any help there would be appreciated
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

Holy frijole!!

I think I might have made accidental progress. In the process of running through the things I have already tried - to be sure if they do or don't work, I discovered that the things I have actually seem to work.

I was trying for a certain behaviour between right and left mouse clicks. In testing I have a reasonably decent version that seems to work. Just the actions are a bit strange.

I have to carefully run through things still, and get the behaviours going with the correct buttons. but ya. viola! something! some thing...
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

CodeCode wrote: December 17th, 2021, 6:15 am Holy frijole!!

I think I might have made accidental progress. In the process of running through the things I have already tried - to be sure if they do or don't work, I discovered that the things I have actually seem to work.

I was trying for a certain behaviour between right and left mouse clicks. In testing I have a reasonably decent version that seems to work. Just the actions are a bit strange.

I have to carefully run through things still, and get the behaviours going with the correct buttons. but ya. viola! something! some thing...
That said, it would still help to find a way around the backslash showing up when substituting empty string for 'not empty' string. Um ya, ok, that sounds different.
To reset the favourites the strings cannot be empty or they all fill up with the same value - which is not preferential. The ideal would be for the empty string to actually be "THIS PC". So that the default would be the top level of the directory tree, or 'THIS PC'. and not 'THIS PC\'. But for some reason 'THIS PC' is not going to that top level instead it is in limbo. Not really sure at this point. But them's the facts so far.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by balala »

CodeCode wrote: December 17th, 2021, 5:49 am When setting the value with those bangs, I am getting an anomalous backslash "\". I don't know how to substitute it it for an empty string.
Not sure. Which measure are you talking about? Because the [mPath] measure is returning me This PC, without the final backslash.
And one more thing I just saw: please try to get used to use quotes on every value you're setting with any bang. For instance the first bang of the RightMouseUpAction option of the [Path] meter would be better to be [!SetClip "[mPath]"] (instead of [!SetClip [mPath]]). The bang does perfectly works even without quotes, as long as there are no spaces in the value returned by the [mPath] measure. If such a space appears, the bang doesn't work anymore, unless you're adding the quotes. Some details here or here.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

balala wrote: December 17th, 2021, 5:03 pm Not sure. Which measure are you talking about? Because the [mPath] measure is returning me This PC, without the final backslash.
You might have noticed in this measure:

Code: Select all

[MeterOne]
Meter=Image
ImageName=#@#1.png
ImageTint=#MainColor#
X=180
Y=24
W=40
H=40
LeftMouseUpAction=[!SetOption mPath "Path" """#FaveOne#"""][!CommandMeasure mPath "FollowPath"][!UpdateMeasure mPath][!CommandMeasure mPath "Update"][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
RightMouseUpAction=[!SetVariable FaveOne ""][!WriteKeyValue Variables FaveOne "" "#@#TitanVars.inc"][!SetOption mPath "Path" ""][!CommandMeasure mPath "FollowPath"][!CommandMeasure mPath "Update"][!UpdateMeter *][!Redraw]
DynamicVariables=1
AntiAlias=1
Hidden=0
..I am setting the variable modifying the Path in mPath measure.
If I am using it as is, it does not correctly go to THIS PC correctly and the follow path does not work. The reinforcing the point is that the string cannot be empty. So I was setting the FaveOne variable to "THIS PC" rather than the empty string. But either way the path is not being respected and the follow path goes to a non-existent location that says THIS PC but is not being sent there properly that shows the root dives.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Having Trouble With Variables Being Used To Write To Another Variable

Post by CodeCode »

CodeCode wrote: December 18th, 2021, 4:36 am You might have noticed in this measure:

Code: Select all

[MeterOne]
Meter=Image
ImageName=#@#1.png
ImageTint=#MainColor#
X=180
Y=24
W=40
H=40
LeftMouseUpAction=[!SetOption mPath "Path" """#FaveOne#"""][!CommandMeasure mPath "FollowPath"][!UpdateMeasure mPath][!CommandMeasure mPath "Update"][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
RightMouseUpAction=[!SetVariable FaveOne ""][!WriteKeyValue Variables FaveOne "" "#@#TitanVars.inc"][!SetOption mPath "Path" ""][!CommandMeasure mPath "FollowPath"][!CommandMeasure mPath "Update"][!UpdateMeter *][!Redraw]
DynamicVariables=1
AntiAlias=1
Hidden=0
..I am setting the variable modifying the Path in mPath measure.
If I am using it as is, it does not correctly go to THIS PC correctly and the follow path does not work. The reinforcing the point is that the string cannot be empty. So I was setting the FaveOne variable to "THIS PC" rather than the empty string. But either way the path is not being respected and the follow path goes to a non-existent location that says THIS PC but is not being sent there properly that shows the root dives.
Here is the current version:
That clears the variable with a right click on the button of choice, and in so doing the last right click on the path string becomes the shortcut so a left click on the same button, that follows that path.
Titan with Fave Version_v.v.2.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: Having Trouble With Variables Being Used To Write To Another Variable

Post by death.crafter »

CodeCode wrote: December 18th, 2021, 4:40 am Here is the current version:
That clears the variable with a right click on the button of choice, and in so doing the last right click on the path string becomes the shortcut so a left click on the same button, that follows that path.
Titan with Fave Version_v.v.2.rmskin
How does it do it's things again? Cause right clicks take me to the directory in file explorer. And left clicks follow path. :confused:
from the Realm of Death