It is currently March 29th, 2024, 9:44 am

Run a vbs script on mouseclick

Get help with creating, editing & fixing problems with skins
sad_story
Posts: 7
Joined: April 19th, 2022, 5:26 pm

Run a vbs script on mouseclick

Post by sad_story »

Been having troubles figuring out how to mousclick to run a vbs script located C:\Extra-Customization\connectForce.vbs

Code: Select all

[AIRPODS Connect]
Meter=Image
X=950
Y=0
W=100
H=20
SolidColor=0,0,0,1
LeftMouseDownAction=["C:\Extra-Customization\connectForce.vbs"]

I am assuming I am missing something obvious (and I am a total newb, this is my first skin.

Any ideas advice kindly appreciated
Last edited by balala on April 20th, 2022, 5:09 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Run a vbs script on mouseclick

Post by balala »

sad_story wrote: April 20th, 2022, 4:51 pm Been having troubles figuring out how to mousclick to run a vbs script located C:\Extra-Customization\connectForce.vbs
You probably should have to try to use a RunCommand plugin measure. Add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=C:\Extra-Customization\connectForce.vbs
State=Hide
You can replace the State=Hide with State=Show is you want not to have hidden the window.
Now replace the LeftMouseDownAction option of your [AIRPODS Connect] meter with the following one: LeftMouseDownAction=[!CommandMeasure "MeasureRun" "Run"].

Additional notes:
  • Recommend not to use LeftMouseDownAction, but LeftMouseUpAction. You can find out why in the Note here.
  • Even if not forbidden, is not a good idea either to use spaces in names of section, on variables and so on. Usually this doesn't create problems, however you have to be extremely careful to quote the space-containing names in bangs. Sooner or latter this will lead a skin not to work properly. So, another recommendation is to replace the [AIRPODS Connect] meter name with [AIRPODSConnect] (or anything else with no spaces).
sad_story
Posts: 7
Joined: April 19th, 2022, 5:26 pm

Re: Run a vbs script on mouseclick

Post by sad_story »

Thank you!

Read your link re: spaces, adjusted that as well.

:)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Run a vbs script on mouseclick

Post by balala »

sad_story wrote: April 21st, 2022, 1:43 am Thank you!
Did it work?
sad_story
Posts: 7
Joined: April 19th, 2022, 5:26 pm

Re: Run a vbs script on mouseclick

Post by sad_story »

balala wrote: April 21st, 2022, 12:24 pmDid it work?
Yes, sorry. It totally worked like a charm - thanks

People on this forum are amazingly helpful
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Run a vbs script on mouseclick

Post by balala »

sad_story wrote: April 21st, 2022, 2:07 pm Yes, sorry. It totally worked like a charm - thanks

People on this forum are amazingly helpful
:thumbup: