It is currently March 29th, 2024, 12:49 pm
Tips and Tricks from the Rainmeter Community
Terrorlone
Posts: 6 Joined: August 15th, 2011, 12:08 pm
Post
by Terrorlone » August 15th, 2011, 7:42 pm
I just search the forum and found there're already several methods to copy a string into clipboard, but before I did that, I tried to come up with my own method, and I still prefer mine after read those posts. So I'll share it to you.
First save the following code into a VBS file, say "toCB.vbs" in my case, and put it into the same folder as the skin.
Code: Select all
Dim Form, TextBox
Set Form = CreateObject("Forms.Form.1")
Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object
TextBox.Text = WScript.Arguments.Item(0)
TextBox.SelStart = 0
TextBox.SelLength = TextBox.TextLength
TextBox.Copy
Then, whenever you want to copy a string into clipboard, use the following.
Code: Select all
LeftMouseUpAction=!Execute ["C:\WINDOWS\System32\WScript.exe" "#CURRENTPATH#toCB.vbs" "String to be copied"]
That's it!
Smorkster
Posts: 19 Joined: April 30th, 2012, 12:33 pm
Post
by Smorkster » June 28th, 2012, 7:35 am
Thanks for this script, seems much simpler than having to use a separate program
KreAch3R
Posts: 608 Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR
Post
by KreAch3R » June 28th, 2012, 8:31 am
This has been simplified a lot. Use the intergrated
!SetClip bang instead.
!SetClip [String]
Copies the specified string to the Windows clipboard.
Rainmeter Manual - !Bangs