It is currently September 21st, 2020, 1:38 pm

CTRL C...

Help with creating, editing & fixing problems with skins
User avatar
brax64
Posts: 148
Joined: July 8th, 2018, 8:05 pm

CTRL C...

Post by brax64 »

Hi all,

I'm wondering if there's a way to copy to clipboard a string visualized by a meter with a mouse action, like
RightMouseUpAction = CTRL+C so to speak...

Thanks in advance for any hints

Cheers!
Last edited by brax64 on September 14th, 2020, 9:45 pm, edited 1 time in total.
User avatar
Jeff
Posts: 153
Joined: September 3rd, 2018, 11:18 am

Re: CTRL C...

Post by Jeff »

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

Re: CTRL C...

Post by balala »

brax64 wrote: September 14th, 2020, 8:08 pm I'm wondering if there's a way to copy to clipboard a string visualized by a meter with a mouse action, like
RightMouseUpAction = CTRL+C so to speak...
As Jeff said, you have to use the !SetClip bang. For instance with the following option you can copy the value returned by the [SomeMeasure] measure, to clipboard: RightMouseUpAction=[!SetClip "[SomeMeasure]"].
Or with the following option, you can copy the value of the SomeVariable variable: RightMouseUpAction=[!SetClip "#SomeVariable#"].
User avatar
brax64
Posts: 148
Joined: July 8th, 2018, 8:05 pm

Re: CTRL C...

Post by brax64 »

Jeff wrote: September 14th, 2020, 8:24 pm !SetClip
balala wrote: September 14th, 2020, 8:38 pm As Jeff said, you have to use the !SetClip bang. For instance with the following option you can copy the value returned by the [SomeMeasure] measure, to clipboard: RightMouseUpAction=[!SetClip "[SomeMeasure]"].
Or with the following option, you can copy the value of the SomeVariable variable: RightMouseUpAction=[!SetClip "#SomeVariable#"].
Thanks Jeff, balala

Used
RightMouseUpAction=[!SetClip "[NetworkAdapterDescription]"][!ToggleMeter ShowAdapter]
It works perfectly, copy the string and hide the meter.
balala wrote: September 14th, 2020, 8:38 pm RightMouseUpAction=[!SetClip "#SomeVariable#"]
Did try that first but it returns literally #SomeVariable#, not its value...
User avatar
balala
Rainmeter Sage
Posts: 11374
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CTRL C...

Post by balala »

brax64 wrote: September 14th, 2020, 9:12 pm Did try that first but it returns literally #SomeVariable#, not its value...
This happens only if the SomeVariable isn't created. Do you have a SomeVariable=whatever option in the [Variables] section, or at least a [!SetVariable SomeVariable "whatever"] bang somewhere in your code, to have a value for the SomeVariable variable? Because I suppose you have no...
To check this add a simple String meter, to see the value of the variable. Something like this:

Code: Select all

[MeterVariable]
Meter=String
Fontsize=15
FontFace=Segoe UI
FontColor=220,220,220
AntiAlias=1 
StringAlign=Left
x=0
y=0
Text=#SomeVariable#
DynamicVariables=1
SolidColor=0,0,0,150
Padding=15,5,15,5
Note that if you change the SomeVariable with !SetVariable bang, you do need to add a DynamicVariables=1 option to the meter where you want to use the variable, particularly to the meter where the above RightMouseUpAction is set. However even if you forgot to set on dynamic variables, you still won't get #SomeVariable#, rather its not-updated value.
User avatar
brax64
Posts: 148
Joined: July 8th, 2018, 8:05 pm

Re: CTRL C...

Post by brax64 »

balala wrote: September 15th, 2020, 12:39 pm This happens only if the SomeVariable isn't created...
Hi balala,
double check my code and noticed that when I did try to use the variable instead of the string measure, I misspelled the variable name, (#Adatper# instead of #Adapter#) that's the reason... my bad, sorry about that.
User avatar
balala
Rainmeter Sage
Posts: 11374
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CTRL C...

Post by balala »

brax64 wrote: September 15th, 2020, 5:45 pm double check my code and noticed that when I did try to use the variable instead of the string measure, I misspelled the variable name, (#Adatper# instead of #Adapter#) that's the reason... my bad, sorry about that.
Don't worry, it happens to all of us, from time to time. I guessed there something like this has gone on...