It is currently April 27th, 2024, 12:06 pm

Paste from clipboard?

Get help with creating, editing & fixing problems with skins
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Paste from clipboard?

Post by RicardoTM »

Just a quick question, is there a way to paste what's in the clipboard? Like, using !SetClip and then pasting that on another part of the skin. I want to use this to paste colors not using InputText.
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Paste from clipboard?

Post by balala »

RicardoTM wrote: March 1st, 2024, 3:12 pm Just a quick question, is there a way to paste what's in the clipboard? Like, using !SetClip and then pasting that on another part of the skin. I want to use this to paste colors not using InputText.
The classic way? Like clicking where you want to paste the content of clipboard and hitting Ctrl - V.
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Paste from clipboard?

Post by RicardoTM »

balala wrote: March 1st, 2024, 4:04 pm The classic way? Like clicking where you want to paste the content of clipboard and hitting Ctrl - V.
I mean, to use it to set a variable, something like [!SetVariable Color $Clipboard$]. Or an Option, like [!SetOption meter fontcolor $Clipboard$]
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Paste from clipboard?

Post by CodeCode »

the !SEtClip bang is usually for that, but I am guessing that is too simple. The setclip is flexible like any Bang, but it would rely on either a variable that is already set or to use the inputtext feature with the setrclip in fron=t. like this: !SetClip $TypedText$ or a set from a variable such as like this; !SetClip "Test"
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Paste from clipboard?

Post by RicardoTM »

CodeCode wrote: March 1st, 2024, 4:40 pm the !SEtClip bang is usually for that, but I am guessing that is too simple. The setclip is flexible like any Bang, but it would rely on either a variable that is already set or to use the inputtext feature with the setrclip in fron=t. like this: !SetClip $TypedText$ or a set from a variable such as like this; !SetClip "Test"
Yah I know, but !SetClip is to copy to the clipboard, I need to paste what's in the clipboard to use it in a bang. Like on a color selector you can usually copy the color that you selected, but, I want a way to insert a color into the selector without using InputText because that requires Click - Ctrl+V - Enter. A one click solution would be great.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Paste from clipboard?

Post by CodeCode »

You could use whatever you are getting the vlaue with, in conjunction with a lerftmouseupaction that's purpose is to past a variable in there. Something (not exactly) Setvariable into the value. that idea might also require !WriteKeyValue to have it happen as soon as the variablee is changed/updated. OnCHangeaction or onUpdateAction as the modus.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Paste from clipboard?

Post by eclectic-tech »

RicardoTM wrote: March 1st, 2024, 4:19 pm I mean, to use it to set a variable, something like [!SetVariable Color $Clipboard$]. Or an Option, like [!SetOption meter fontcolor $Clipboard$]
The Clipboard plugin may help you. After !SetClip the value of this measure will be the most recent clipboard item.

Code: Select all

[MeasureClip]
Measure=Plugin
Plugin=PluginClipboard
DynamicVariables=1
You can !SetVariable Color [MeasureClip] or !SetOption meter FontColor [MeasureClip]

Easiest way to get the Clipboard plugin is from SilverAzide's Gadget patch.
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Paste from clipboard?

Post by balala »

RicardoTM wrote: March 1st, 2024, 4:19 pm I mean, to use it to set a variable, something like [!SetVariable Color $Clipboard$]. Or an Option, like [!SetOption meter fontcolor $Clipboard$]
Oh, sorry, I misunderstood you, but now I see what you need. Actually there is a way to achieve what you want. You have to use a RunCommand measure, to get assigned the content of the clipboard as a variable.
If you want to try this out, add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=get-clipboard
OutputType=ANSI
OnChangeAction=[!SetVariable Variable "[MeasureRun]"]
State=Hide
When executing this measure, you get the content of the clipboard pasted into the Variable variable.
Now to execute the measure, use for instance a mouse action like this one: LeftMouseUpAction=[!CommandMeasure "MeasureRun" "Run"]. If you add this option to a meter, you get the content of the clipboard assigned to the Variable variable, when you click the meter.
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Paste from clipboard?

Post by RicardoTM »

eclectic-tech wrote: March 1st, 2024, 5:00 pm The Clipboard plugin may help you. After !SetClip the value of this measure will be the most recent clipboard item.

Code: Select all

[MeasureClip]
Measure=Plugin
Plugin=PluginClipboard
DynamicVariables=1
You can !SetVariable Color [MeasureClip] or !SetOption meter FontColor [MeasureClip]

Easiest way to get the Clipboard plugin is from SilverAzide's Gadget patch.
This is exactly what I'm looking for. Thank you E-T.
RicardoTM
Posts: 268
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Paste from clipboard?

Post by RicardoTM »

balala wrote: March 1st, 2024, 5:04 pm Oh, sorry, I misunderstood you, but now I see what you need. Actually there is a way to achieve what you want. You have to use a RunCommand measure, to get assigned the content of the clipboard as a variable.
If you want to try this out, add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=get-clipboard
OutputType=ANSI
OnChangeAction=[!SetVariable Variable "[MeasureRun]"]
State=Hide
When executing this measure, you get the content of the clipboard pasted into the Variable variable.
Now to execute the measure, use for instance a mouse action like this one: LeftMouseUpAction=[!CommandMeasure "MeasureRun" "Run"]. If you add this option to a meter, you get the content of the clipboard assigned to the Variable variable, when you click the meter.
Thanks Balala! I'll also try this method.