It is currently September 8th, 2024, 4:42 am

Launch App

Get help with creating, editing & fixing problems with skins
Aryx
Posts: 41
Joined: December 20th, 2023, 9:18 am

Launch App

Post by Aryx »

A simple enough task: Open an application.

What gets the task done (also mentioned in documentation):

Code: Select all

[Image]
Meter=Image
W=150
H=225
ImageName=#@#SomeImage.png
LeftMouseUpAction=[SomeLNKorEXE.lnk]
What SHOULD work, but, does not:

Code: Select all

[Variables]
Path=SomeLNKorEXE.lnk

[Image]
Meter=Image
W=150
H=225
ImageName=#@#SomeImage.png
LeftMouseUpAction=[#Path#]
It does not matter how the variable is declared, or even if it has any spaces, etc. Is it related to some specific meter type? Why does an application does not open when routed through a variable, and gets executed when written directly?
Last edited by Aryx on June 27th, 2024, 3:08 pm, edited 1 time in total.
User avatar
Active Colors
Moderator
Posts: 1297
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Launch App

Post by Active Colors »

Can you post the full code? With the [Rainmeter] section and example address to the actual .lnk you are pointing the “Path” variable to.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launch App

Post by balala »

Aryx wrote: June 27th, 2024, 2:35 pm Is it related to some specific meter type?
No, it's not. Try to quote the variable in the LeftMouseUpAction option: LeftMouseUpAction=["#Path#"]. And I definitely would move the SomeLNKorEXE.lnk file to the @Resources folder and would use it accordingly: LeftMouseUpAction=["#@##Path#"]. All this kind of resource files should be placed into the @Resources folder.
Aryx
Posts: 41
Joined: December 20th, 2023, 9:18 am

Re: Launch App

Post by Aryx »

Neat! I thought adding the quotes to the variable directly did not work, and drew a conclusion that it would do the same if I'd place the quotes in the (whatever this is called) as ["#Path#"] or ["#@##Path#"].
Active Colors wrote: June 27th, 2024, 2:46 pm Can you post the full code? With the [Rainmeter] section and example address to the actual .lnk you are pointing the “Path” variable to.
It really was a meter-long code, and I already provided the relevant portion of it. The actual .lnk's path had no spaces or special symbols, but, I had it on a different drive altogether and not in the @Resources folder.

Thank you for providing me with a short and to the point solution yet again @balala, and the next time on, I'll be sure to add such resources to the aforementioned folder.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launch App

Post by balala »

Aryx wrote: June 27th, 2024, 3:07 pm Neat! I thought adding the quotes to the variable directly did not work, and drew a conclusion that it would do the same if I'd place the quotes in the (whatever this is called) as ["#Path#"] or ["#@##Path#"].
Adding quotes directly to the variable (in the [Variables] section) is completely useless. Those quotes in such cases are just stripped off and ignored. Adding quotes to the variables into the LeftMouseUpAction option is absolutely needed if the value of the variable contains space(s). If there are no spaces, the quotes are practically not needed, but it's always a good practice to get used to use the, This way you'll have no forgetting issues later.
So, is the issue fixed? Does the mouse action work properly?
Aryx wrote: June 27th, 2024, 3:07 pm @balala, and the next time on, I'll be sure to add such resources to the aforementioned folder.
Another good and recommended practice.
Aryx
Posts: 41
Joined: December 20th, 2023, 9:18 am

Re: Launch App

Post by Aryx »

It is fixed! Thank you again.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launch App

Post by balala »

Aryx wrote: June 27th, 2024, 5:31 pm It is fixed! Thank you again.
Glad to help. :thumbup:
User avatar
Active Colors
Moderator
Posts: 1297
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Launch App

Post by Active Colors »

It is not a necessity to keep .lnk files in the skin’s directory. If this is how you want to make your skin - that’s fine, but it is not a must. It is just as fine to keep them in some other folder at your computer. However you like.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Launch App

Post by balala »

Active Colors wrote: June 28th, 2024, 1:04 pm It is not a necessity to keep .lnk files in the skin’s directory. If this is how you want to make your skin - that’s fine, but it is not a must. It is just as fine to keep them in some other folder at your computer. However you like.
Right, however if the .lnk file has been created for the skin, in my opinion it should be kept in the @Resouces folder. If it's a file on the computer, used not just to launch the program by the Rainmeter skin, then indeed it can be stored anywhere on the computer.