It is currently April 20th, 2024, 12:42 pm

Action on Refresh, but not on Load

Tips and Tricks from the Rainmeter Community
User avatar
Cariboudjan
Posts: 268
Joined: May 12th, 2019, 8:55 am

Action on Refresh, but not on Load

Post by Cariboudjan »

For how to do an action on Load but not on Refresh, see here.

The below will do the opposite. It will execute a command when refreshed, but unlike OnRefreshAction, it will not execute on the skin's initial load.

Code: Select all

;When skin is opened, the variable is written (but not set) as 0. When closed, it is reverted back to 1.
[Rainmeter]
OnRefreshAction=[!WriteKeyValue Variables SkinClosed 0]
OnCloseAction=[!WriteKeyValue Variables SkinClosed 1]

;Below variable is 1 when the skin is closed, and 0 when the skin is open
[Variables]
SkinClosed=1

;Below condition is always true, but is disabled until #SkinClosed# equals 0, which it will not unless it is opened, and then refreshed. Therefor, the action will only occur when a skin is refreshed, but not when initially loaded.
[CheckIfSkinIsOpen]
Measure=Calc
IfCondition=1=1
IfTrueAction=EXECUTE SOME COMMANDS
Disabled=#SkinClosed#