Page 2 of 2

Re: move windows clicking

Posted: July 6th, 2010, 4:17 pm
by JpsCrazy
As you probably figured out, dynamic variables don't work with .Inc files.
Although messy, long !executes are sometimes necessary. I have some that are 60+ !bangs long.

Re: move windows clicking

Posted: July 6th, 2010, 4:40 pm
by smurfier
The way an include file works is that the information in that file is pretty much written into the config you want it to be in. That include file is not changed by Rainmeter and if you change a variable value using a bang that change only affects that config. If you want to change a variable value in an include file and have all configs change after that, you will need to use nircmd to change the include file and then use bangs to refresh all the configs that use the include file.

Re: move windows clicking

Posted: July 6th, 2010, 6:28 pm
by jsmorley
Of course dynamic variables work with .inc files, and it is NOT true that using a bang to change a variable from a .inc file in a running config only effects that config. What?
TestVars.rmskin
As with most bangs you can specify the name of the config to effect on the end of !RainmeterSetVariable, or use "*" to mean all. There is no reason why a change to a dynamic variable housed in a .inc file can't effect all running skins.

What is true is that any change to a dynamic variable done with !RainmeterSetVariable only survives up to the point any skin using the variable is refreshed, at which point, for that skin, it returns to the original definition of the value, whether in a .inc or in the actual .ini. If you want to PERMANENTLY change a variable, then indeed you will need some addon to literally change the value in the .inc file and then send a !RainmeterRefresh * to tell all skins about the new default value for the variable.

Now it may be true or not that the way the original person with the question is using variables won't work, I have not followed the thread. However, I can't let blanket statements that are just wrong like "dynamic variables don't work with .inc files" or ""if you change a variable value using a bang that change only affects that config" stand without some correction.

Re: move windows clicking

Posted: July 6th, 2010, 8:12 pm
by JpsCrazy
Either I'm being slow or something, bur the manual says: Note: It's possible to use the variables with the @include but dynamic variables won't work with the @include.

Re: move windows clicking

Posted: July 6th, 2010, 8:20 pm
by jsmorley
JpsCrazy wrote:Either I'm being slow or something, bur the manual says: Note: It's possible to use the variables with the @include but dynamic variables won't work with the @include.
I believe what that means is that dynamic variables can't be used "as" the @Include.

@Include=#SomeIncludeFile#

and allow changing to a different file dynamically.

So this:

[Variables]
IncFile=..\Text.inc
@Include=#IncFile#

LeftMouseUpAction=!Execute [!RainmeterSetVariable IncFile "..\OtherText.inc" *]

Will not work as far as I know.

I just wanted to be clear that you can certainly define variables in a .inc file and use them, change them dynamically, have the change with !RainmeterSetVariable effect any or all skins at once, etc.

Re: move windows clicking

Posted: July 7th, 2010, 11:47 am
by Pechorin
nice example :), thanks!

it works as expected, but not as i would like to. the problem is that my skin moves and activates/deactivates configs. if the config is opened, it moves perfectly, but if it has to be opened in a different position, it reads the original value of the file, and not the current value used by the main config. that's logic, but annoying for my case :(

although i have thought another way to do more or less the same, it consists in open every configs at the beggining but with all meters hidden and measures deactivated. so i have a pair of quick questions more...
is there any way to activate/deactivate every config in a folder + subfolders? (when i refresh, i want to close every config previously opened too)
or, is there any way to disable every measure in a config with a single command? and hide all the meters?

i am sorry for so many questions, but i am kinda excited with this tool and making my very first skin :)

thanks everybody for the help!

Re: move windows clicking

Posted: July 7th, 2010, 4:25 pm
by Alex2539
You can't open all of the configs at once. However, once a config is open, you can hide it completely using !RainmeterHide (Config). This won't disable the measures, but it will hide the entire config from view.

Re: move windows clicking

Posted: July 7th, 2010, 5:32 pm
by smurfier
Of course you can send a bang to all configs. With a bang such as !RainmeterSetVariable one does need to be sure that the variable you're changing exists in only the configs that you wish to change it in. If that variable name is used in another config where dynamic variables are not activated wherever the variable in used, then that config would cease to function correctly. It would be more wise to use a separate bang for each config, stringing them together with the !Execute bang.

Re: move windows clicking

Posted: July 7th, 2010, 5:54 pm
by Alex2539
smurfier wrote:If that variable name is used in another config where dynamic variables are not activated wherever the variable in used, then that config would cease to function correctly.
It's the other way around. If the variable name exists in a config that IS using Dynamic Variables, then it will use the new value whether you want it to or not. If something is reading a variable without DynamicVariables=1 and the variable is changed, it will simply continue using the original value.

Re: move windows clicking

Posted: July 7th, 2010, 5:56 pm
by smurfier
Forgot about that one.