I have no clue but seems it is possible
Say I write down a variable to a file so that other skins I have can reuse that variable
I have 10 separate skins so if let's say someone input color, font size and stuff like that into one single file and it gets transferred to all other remaining skins
I just need to find out how, I can figure the rest on my one (like a small tip)
Also would be nice if I someone can point me a way to make it interactive (like instead of editing ini file user can load that ini skin and have a bar where they can enter those data I mentioned above cause I've seen them doing but looks too complicated to read for me)
It is currently April 25th, 2024, 6:33 am
Import variable from another file?
-
- Posts: 93
- Joined: February 5th, 2017, 4:50 am
Import variable from another file?
deXxterlab97
-
- Posts: 860
- Joined: August 22nd, 2016, 11:32 pm
- Location: Surrey, B.C., Canada
Re: Import variable from another file?
Have you had a look at this?
https://docs.rainmeter.net/tips/include-guide/
https://docs.rainmeter.net/tips/include-guide/
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
Deviant Art Page
-
- Rainmeter Sage
- Posts: 16168
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Import variable from another file?
Problem is that even if you're including the file where you write those variables, into each of the 10 skins, you'll have to refresh the skins in order to the newly written variables can be used.deXxterlab97 wrote:Say I write down a variable to a file so that other skins I have can reuse that variable
I have 10 separate skins so if let's say someone input color, font size and stuff like that into one single file and it gets transferred to all other remaining skins
I'd suggest another approach: write those variables in to the appropriate file and in parallel, use some !SetVariableGroup (or !SetVariable) bangs to set the values of the variables in each skin.
The simplest approach to do this, I think would be the following one: first add each of the desired skins, to a group. So, add a Group=MyGroup option to the [Rainmeter] section of each skin.
Then where you want to write the variable into the shared file (where the, probably, !WriteKeyValue bang is used), add a this kind of bang: [!SetVariableGroup FontSize "12" "MyGroup"], to set the value of the FontSize variable, in each skin belonging to the MyGroup group. This bang will set the FontSize variable in those skins to 12.
Obviously this was just an example of how can you achieve what you want. For further help, it would be nice to post some code.
-
- Posts: 93
- Joined: February 5th, 2017, 4:50 am
Re: Import variable from another file?
I guess this kinda solves my problem. Thanksbalala wrote:Problem is that even if you're including the file where you write those variables, into each of the 10 skins, you'll have to refresh the skins in order to the newly written variables can be used.
I'd suggest another approach: write those variables in to the appropriate file and in parallel, use some !SetVariableGroup (or !SetVariable) bangs to set the values of the variables in each skin.
The simplest approach to do this, I think would be the following one: first add each of the desired skins, to a group. So, add a Group=MyGroup option to the [Rainmeter] section of each skin.
Then where you want to write the variable into the shared file (where the, probably, !WriteKeyValue bang is used), add a this kind of bang: [!SetVariableGroup FontSize "12" "MyGroup"], to set the value of the FontSize variable, in each skin belonging to the MyGroup group. This bang will set the FontSize variable in those skins to 12.
Obviously this was just an example of how can you achieve what you want. For further help, it would be nice to post some code.
I just have this small Variables
Code: Select all
[Variables]
FontFace=Ubuntu
FontColor=255,255,255,240
FontSize=11
deXxterlab97
-
- Posts: 93
- Joined: February 5th, 2017, 4:50 am
Re: Import variable from another file?
Yeah that's what I was looking for. How does that different from what balala did?CyberTheWorm wrote:Have you had a look at this?
https://docs.rainmeter.net/tips/include-guide/
deXxterlab97
-
- Rainmeter Sage
- Posts: 16168
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Import variable from another file?
Does it?deXxterlab97 wrote:I guess this kinda solves my problem.
With an @Include option, you can add an ini formatted file to your code and your skin will be able to use the variables (sections) of the included file. But as I said, if simply write a variable in that file, the skin won't be able to use the newly written variable, just if you refresh the skin. That's why I proposed to set the value of the variable (with the !SetVariable or the !SetVariableGroup bang) into all skins, when it is written to the included file.deXxterlab97 wrote:Yeah that's what I was looking for. How does that different from what balala did?
-
- Posts: 93
- Joined: February 5th, 2017, 4:50 am
Re: Import variable from another file?
ok thanksbalala wrote:Does it?
With an @Include option, you can add an ini formatted file to your code and your skin will be able to use the variables (sections) of the included file. But as I said, if simply write a variable in that file, the skin won't be able to use the newly written variable, just if you refresh the skin. That's why I proposed to set the value of the variable (with the !SetVariable or the !SetVariableGroup bang) into all skins, when it is written to the included file.
deXxterlab97
-
- Rainmeter Sage
- Posts: 16168
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Import variable from another file?
You're welcome.
If you have any other question, just please let me (us) know.
If you have any other question, just please let me (us) know.