How to clear clipboard

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ari
Junior Coder
Posts: 23
Joined: Tue Jul 15, 2014 4:12 pm

How to clear clipboard

Post by ari » Thu Nov 03, 2016 5:14 am

Is there a command to empty the clipboard? I am using a text expander program that also uses the clipboard and want a way to clear the clipboard before MS uses it. Also, how much wait time is typically required for clipboard operations? It feels sluggish compared to other functions.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to clear clipboard

Post by Marcus Tettmar » Thu Nov 03, 2016 4:00 pm

You can't really "clear" the clipboard but you could put an empty string on it. Like this:

PutClipBoard>

Or for readability:

PutClipBoard>{""}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: How to clear clipboard

Post by CyberCitizen » Mon Nov 14, 2016 3:59 am

Normally what I do is I GetClipBoard to a variable to save what was there first.

Do what I need with the script etc and when finish PutClipboard to put back what was there previously.

It's good scripting and you can save it as a SubRoutine etc and save it in your code snippets to make it easier to include in all your scripts etc.

But yes to clear it, do as what Marcus suggested.
FIREFIGHTER

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts