It is currently May 1st, 2024, 2:55 pm

[Solved] RainmeterWriteKeyValue and Manual Value Change

Get help with creating, editing & fixing problems with skins
NictraSavios
Posts: 30
Joined: August 23rd, 2011, 8:21 am
Location: Nova Scotia, Canada

[Solved] RainmeterWriteKeyValue and Manual Value Change

Post by NictraSavios »

Okay So, long story short I wrote a script to toggle the enigma toggle ( For the full story, click here)

And I use this as the code

Code: Select all

Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterHideGroup "EnigmaSidebar"
IniWrite, %stateone%, %Toggle%, Variables, State2
IniWrite, %statetwo%, %Toggle%, Variables, State1
Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterRefresh
This ( ^ up above ^ ) is the code to hide the sidebar, to show it, the first line is:

Code: Select all

Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterHideGroup "EnigmaSidebar"
and the rest is the same. Since the variables are re-read each time, It works Perfectly.

I believe this dose the same as

Code: Select all

!Execute [!Rainmeter#State1#Group EnigmaSidebar][!RainmeterWriteKeyValue Variables State1 #State2#][!RainmeterWriteKeyValue Variables State2 #State1#][!RainmeterRefresh]

But the problem is... I can see it writes the values to the .ini, It hides the meter group, and it refreshes it...
BUT. after hiding it, it comes right back....

Even when I did

Code: Select all

 Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !Execute [!RainmeterHideGroup EnigmaSidebar][!RainmeterWriteKeyValue Variables State1 Show][!RainmeterWriteKeyValue Variables State2 Hide][!RainmeterRefresh] 
I just did the same thing, disappears then comes right back.

Why?
Last edited by NictraSavios on August 24th, 2011, 5:22 pm, edited 1 time in total.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: RainmeterWriteKeyValue and Manual Value Change

Post by Kaelri »

When you send a !Refresh or !RainmeterRefresh command from a Rainmeter skin, it refreshes only that skin. When you send the command from an external application, it will refresh all active skins unless you target a specific skin. I would use this command instead:

Code: Select all

Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterRefresh "Enigma\Taskbar\Toggle"
NictraSavios
Posts: 30
Joined: August 23rd, 2011, 8:21 am
Location: Nova Scotia, Canada

Re: RainmeterWriteKeyValue and Manual Value Change

Post by NictraSavios »

Kaelri wrote:When you send a !Refresh or !RainmeterRefresh command from a Rainmeter skin, it refreshes only that skin. When you send the command from an external application, it will refresh all active skins unless you target a specific skin. I would use this command instead:

Code: Select all

Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !RainmeterRefresh "Enigma\Taskbar\Toggle"
But then what about the rest of the skin that needs to be refreshed... The value I edit makes parts of the skin disapear. (atleast it dose when you double click the toggle) ... do those parts need to be refreshed? If so, would I refresh Enigma\Sidebar\* (idk if that wild card would work)
Last edited by NictraSavios on August 24th, 2011, 5:00 pm, edited 1 time in total.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: RainmeterWriteKeyValue and Manual Value Change

Post by Kaelri »

Skins do not need to be refreshed for Show and Hide commands to take effect. On the contrary: refreshing is akin to "resetting" a skin, which includes resetting its visibility state to default.
NictraSavios
Posts: 30
Joined: August 23rd, 2011, 8:21 am
Location: Nova Scotia, Canada

Re: RainmeterWriteKeyValue and Manual Value Change

Post by NictraSavios »

Kaelri wrote:Skins do not need to be refreshed for Show and Hide commands to take effect. On the contrary: refreshing is akin to "resetting" a skin, which includes resetting its visibility state to default.
So then why dose it not do anything If I don't include that command? Or is it because I only need to refresh the toggle?

EDIT: That works, now I just have 1-2 minor bugs to sort out.
EDIT2: Sorted them out :) Ready for release after some testing
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: RainmeterWriteKeyValue and Manual Value Change

Post by Kaelri »

These commands -

Code: Select all

Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !HideGroup EnigmaSidebar
Run, "C:\Program Files\Rainmeter\Rainmeter.exe" !ShowGroup EnigmaSidebar
- should work fine all by themselves. You should also be able to run them from the command line or the Run dialog and have the same effect.

The other skins are not dependent on the Toggle skin in any way; the only purpose of refreshing the skin is to keep it in sync with the current visibility state of the sidebar (i.e. so that it doesn't send a "Hide" command when the skins are already hidden, or vice versa).