It is currently May 19th, 2019, 7:46 am

Skins: !Execute deprecated

Changes made during the Rainmeter 2.5 beta cycle and earlier.
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Skins: !Execute deprecated

jsmorley » May 13th, 2012, 4:37 pm

We have eliminated the need for the command !Execute when using a bang. That command was a leftover from some long-gone support for LiteStep, and really wasn't needed to define bangs in Rainmeter.

So:
LeftMouseUpAction=!Execute [!HideMeter Meter1][!Redraw]
becomes:
LeftMouseUpAction=[!HideMeter Meter1][!Redraw]

And:
LeftMouseUpAction=!Execute ["C:\Windows\Notepad.exe"]
becomes:
LeftMouseUpAction=["C:\Windows\Notepad.exe"]

You still need the brackets [] to indicate multiple bangs on one action, and should use the brackets when calling external applications enclosed in quotes, but no longer need the !Execute at any time.

http://rainmeter.net/cms/Bangs_beta
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: !Execute has been made optional in bangs

XANCI » May 14th, 2012, 6:34 am

Once I downloaded the latest beta I delete all "!Execute" in my skin but here are two problems

some old one:

Code: Select all

LeftMouseUpAction=!Execute ["notepad.exe" "#CURRENTPATH##CURRENTFILE#"]
and this is from http://rainmeter.net/cms/Bangs_beta

Code: Select all

LeftMouseUpAction="C:\Windows\Notepad.exe" "FileToOpen.txt"
so it goes to

Code: Select all

LeftMouseUpAction="notepad.exe" "#CURRENTPATH##CURRENTFILE#"
but this won't work, and I realized that Rainmeter will treat matched quotes around an option/variable as the indicator so the actual option is

Code: Select all

notepad.exe" "#CURRENTPATH##CURRENTFILE#
however

Code: Select all

LeftMouseUpAction=""C:\Windows\Notepad.exe" "FileToOpen.txt""
and

Code: Select all

LeftMouseUpAction=["C:\Windows\Notepad.exe" "FileToOpen.txt"]
will work


also I use

Code: Select all

RightMouseUpAction=!Execute
to block Rainmeter's context menu, any idea for not using "!Execute" ?
poiru
Developer
Posts: 2877
Joined: April 17th, 2009, 12:18 pm

Re: !Execute has been made optional in bangs

poiru » May 14th, 2012, 7:48 am

XANCI wrote:

Code: Select all

LeftMouseUpAction=["C:\Windows\Notepad.exe" "FileToOpen.txt"]
will work
This is the "correct" method. [] should always be used with commands to avoid problems like the one you described (quotes around the value are stripped). The documentation will be updated to reflect this.
XANCI wrote:also I use

Code: Select all

RightMouseUpAction=!Execute
to block Rainmeter's context menu, any idea for not using "!Execute" ?
You should continue to use !Execute there.
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: !Execute has been made optional in bangs

XANCI » May 14th, 2012, 7:57 am

poiru wrote:The documentation will be updated to reflect this.

Code: Select all

LeftMouseUpAction={"C:\Windows\Notepad.exe" "FileToOpen.txt"]
oops, you're too fast to fix this one :)
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !Execute has been made optional in bangs

jsmorley » May 14th, 2012, 12:00 pm

poiru wrote: You should continue to use !Execute there.
You can really use just about anything there to have an action that does nothing, while blocking the native functionality of the click in Rainmeter. This works fine too:

[Meter1]
Meter=Image
SolidColor=255,255,255,255
W=30
H=30
MouseActionCursor=0
RightMouseUpAction=NULL

Personally, I would get out of the habit of using !Execute at all, so I'm not tempted to forget and use it where it isn't needed. To each his own though.
User avatar
Seahorse
Posts: 1220
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: !Execute has been made optional in bangs

Seahorse » May 14th, 2012, 12:19 pm

jsmorley wrote:Personally, I would get out of the habit of using !Execute at all
Forgotten already... 8-)
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

poiru
Developer
Posts: 2877
Joined: April 17th, 2009, 12:18 pm

Re: !Execute has been made optional in bangs

poiru » May 14th, 2012, 12:55 pm

jsmorley wrote:You can really use just about anything there to have an action that does nothing, while blocking the native functionality of the click in Rainmeter. This works fine too:
...
RightMouseUpAction=NULL
It works only as long as you don't have NULL.exe in your PATH (otherwise NULL.exe would be launched).
jsmorley wrote:Personally, I would get out of the habit of using !Execute at all, so I'm not tempted to forget and use it where it isn't needed. To each his own though.
On further thought, I think RightMouseUpAction=[] would be best. It doesn't (try to) do anything and it conveys its purpose more clearly than a bare !Execute.
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !Execute has been made optional in bangs

jsmorley » May 14th, 2012, 1:01 pm

poiru wrote: It works only as long as you don't have NULL.exe in your PATH (otherwise NULL.exe would be launched).
On further thought, I think RightMouseUpAction=[] would be best. It doesn't (try to) do anything and it conveys its purpose more clearly than a bare !Execute.
Yeah, that makes sense.
User avatar
spx
Developer
Posts: 686
Joined: August 15th, 2009, 2:41 pm
Location: Osaka, JPN

Re: !Execute has been made optional in bangs

spx » May 14th, 2012, 1:02 pm

poiru wrote: On further thought, I think RightMouseUpAction=[] would be best. It doesn't (try to) do anything and it conveys its purpose more clearly than a bare !Execute.
I prefer it, too. I'm using !Execute [] for a long time.
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !Execute has been made optional in bangs

jsmorley » May 14th, 2012, 1:04 pm

spx wrote: I prefer it, too. I'm using !Execute [] for a long time.
Yes, the one thing you can't use, as it doesn't work right, is

LeftMouseUpAction=""