It is currently March 28th, 2024, 11:00 am

Help With Launching Applications

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
andyblak
Posts: 12
Joined: May 16th, 2017, 12:09 pm

Help With Launching Applications

Post by andyblak »

Hey all!

I was previously having this issue with the Enigma skin, but I attempted to create my own skin instead. The code is somewhat similar to Enigma, but all self-contained in my own folder with INIs and INCs that I wrote in VS Code.

The issue that I'm having is that EXEs will not launch when clicking on a meter. The Bang for opening Rainmeter Manage and Windows Explorer works just fine. I've attempted using the Environmental Variable for Program Files, and the direct path.

Here is an example meter:

Code: Select all

[Rainmeter]
AccurateText=1
SkinWidth=#AppWidth#
SkinHeight=#AppHeight#
Update=1000
OnRefreshAction=[!SnapEdges "1"]

[Metadata]
Name=App Shortcut 2
Author=AndyBlak
Information=Opens the application selected
Version=0.1
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
@Include1="#@#Variables.inc"
@Include2="#@#Styles.inc"
AppIconVar=AppIconStyleClosed

; =======================================
; Measures
; =======================================

[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName=#App2PathName#

[MeasureAppIcon]
Measure=Calc
IfCondition=MeasureProcess > 0
IfTrueAction=[!SetVariable AppIconVar AppIconStyleRunning]
IfFalseAction=[!SetVariable AppIconVar AppIconStyleClosed]

; =======================================
; Meters
; =======================================
[Background]
Meter=Image
MeterStyle=AppBGStyle
LeftMouseUpAction=[#App2Path#][!Update]

[Border]
Meter=Shape
MeterStyle=AppBorder

[AppIconShadow]
Meter=Image
MeterStyle=AppIconShadowStyle
ImageName=#App2Icon#
LeftMouseUpAction=[#App2Path#][!Update]

[AppIcon]
Meter=Image
MeterStyle=#AppIconVar#
ImageName=#App2Icon#
ToolTipText=#App2Type#
LeftMouseUpAction=[#App2Path#][!Update]

[AppText]
Meter=String
MeterStyle=AppTextStyle
Text=#App2Name#
ToolTipText=#App2Type#
LeftMouseUpAction=[#App2Path#][!Update]
Here is the Variables INC:

Code: Select all

; =======================================
; App Shortcuts
; =======================================
AppHeight=36
AppWidth=130

AppAlpha=100
AppBGColor=0,0,0

App1Name=Explorer
App1Path="explorer.exe"
App1PathName=explorer.exe
App1Type=Files
App1Icon=#@#Images\Start.png

App2Name=MusicBee
App2Path="%ProgramFiles%\MusicBee\MusicBee.exe"
App2PathName=MusicBee.exe
App2Type=Music
App2Icon=#@#Images\MusicBee.png

App3Name=Photoshop
App3Path="C:\Program Files\Adobe\Photoshop Elements 14\WelcomeScreen\Adobe Photoshop Elements 14.0.exe"
App3PathName=PhotoshopElementsEditor.exe
App3Type=Photo Editing
App3Icon=#@#Images\PS.png

App4Name=Rainmeter
App4Path=!Manage
App4PathName=
App4Type=Settings
App4Icon=#@#Images\Rainmeter.png

App5Name=Skype
App5Path="C:\Program Files (x86)\Skype\Phone\Skype.exe"
App5PathName=Skype.exe
App5Type=Communication
App5Icon=#@#Images\Skype.W.png

App6Name=TextPad
App6Path="C:\Program Files\TextPad 8\TextPad.exe"
App6PathName=TextPad.exe
App6Type=Editing
App6Icon=#@#Images\Text.W-2.png

App7Name=VS Code
App7Path="C:\Program Files (x86)\Microsoft VS Code\Code.exe"
App7PathName=Code.exe
App7Type=Coding
App7Icon=#@#Images\VSCode.png
Lastly, the Styles INC:

Code: Select all

[AppIconStyleClosed]
DynamicVariables=1
AntiAlias=1
X=94
Y=5
ImageAlpha=100
H=26
W=26
Greyscale=1

[AppIconStyleRunning]
DynamicVariables=1
AntiAlias=1
X=94
Y=5
ImageAlpha=250
H=26
W=26
Greyscale=1

[AppIconShadowStyle]
DynamicVariables=1
AntiAlias=1
X=97
Y=7
ImageAlpha=100
H=26
W=26
Greyscale=1
ImageTint=000000aa

[AppBorder]
W=#AppWidth#-1
H=#AppHeight#-1
Shape=Rectangle 1,1,(#AppWidth#-2),(#AppHeight#-2) | Fill Color 0,0,0,0 | StrokeWidth 0.3 | Stroke Color #BorderColor#
Any ideas/comment/suggestions would be much appreciated!

-Andy
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help With Launching Applications

Post by balala »

andyblak wrote:The issue that I'm having is that EXEs will not launch when clicking on a meter. The Bang for opening Rainmeter Manage and Windows Explorer works just fine. I've attempted using the Environmental Variable for Program Files, and the direct path.
Try to include the variable into quotations. It contains spaces, so the quotations are absolutely needed. Eg replace the LeftMouseUpAction option of the [Background] meter, with the following one: LeftMouseUpAction=[[color=#FF0000]"[/color]#App2Path#[color=#FF0000]"[/color]][!Update].
This is true, even if you've included the values of the variables into quotations (in the [Variables] section). These quotations are not needed, being ignored: https://forum.rainmeter.net/viewtopic.php?p=137635#p137635
User avatar
andyblak
Posts: 12
Joined: May 16th, 2017, 12:09 pm

Re: Help With Launching Applications

Post by andyblak »

balala wrote:Try to include the variable into quotations. It contains spaces, so the quotations are absolutely needed. Eg replace the LeftMouseUpAction option of the [Background] meter, with the following one: LeftMouseUpAction=[[color=#FF0000]"[/color]#App2Path#[color=#FF0000]"[/color]][!Update].
This is true, even if you've included the values of the variables into quotations (in the [Variables] section). These quotations are not needed, being ignored: https://forum.rainmeter.net/viewtopic.php?p=137635#p137635
THANK YOU SO MUCH!!!!

This was driving me nuts. It's fixed :)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help With Launching Applications

Post by balala »

Glad to help.
Post Reply