Second Clipboard script solved

Post your working scripts, libraries and tools
glogman
Posts: 1
Joined: 19 Jan 2018, 15:07

Second Clipboard script solved

19 Jan 2018, 15:19

I finally managed to write a working script for a second clipboard.

Very basic but useful. It only worked once I decided to spam the ^c command. Still not totally sure why, but without spamming the copy command the script will spew up all kinds of errors and just not work correctly.

Do any of you have any idea why this works?

^g::

OldClip = %Clipboard%
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Send, ^c
Send, ^c
NewClip = %Clipboard%
Clipboard = %OldClip%

return

^h::
Clipboard = %NewClip%
Send, ^v
Clipboard = %OldClip%

return


I also had to "run as administrator." All in all a very long and weird search for what should have been a simple script.
User avatar
Xtra
Posts: 1193
Joined: 02 Oct 2015, 12:15

Re: Second Clipboard script solved

19 Jan 2018, 16:17

Take a look at: ClipWait
Clear the clipboard before sending ^c
Use ClipWait after sending ^c

HTH
User avatar
BGM
Posts: 419
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: Second Clipboard script solved

19 Jan 2018, 21:26

What is a good time for clipwait?

I've had problems with clipboard, too. When I send ctrl+c, sometimes it just sends c - even to notepad.
User avatar
derz00
Posts: 495
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: Second Clipboard script solved

20 Jan 2018, 08:35

Here's a revision of that. Check it out. Let me know what you think.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

try it and see
...

Return to “Scripts and Functions”

Who is online

Users browsing this forum: feiyue and 14 guests