How to Clear the Clipboard - A Finder Annoyance

Back in the old days the Macintosh Finder had a useful option to Clear the Clipboard that was useful and used. This option was dropped some time ago but there is still a need even with the new Lion 10.7.


I do a lot of copy and pasting from Safari and other apps to Apple's Mail and one of the annoying things in the 10.7 Finder is either the copy or paste command sometimes does not clear the clipboard. Then next time you try to copy something the previous item copied is pasted. This clipboard constipation is when the old Finder Clear Clipboard menu button would be handy.


I don't see Apple giving us back the Clear Clipboard in the Finder; however, I have a hold over Automator script from Snow Leopard 10.6 that works just as well in 10.7. All I have to do is pull down the File/Services Menu a select the option to Clear Clipboard. I can then copy the new item to the clipboard.


http://imageshack.us/photo/my-images/705/clearclipboard2.png/


If you have experienced the same clipboard constipation and are into AppleScripts and Automator the script is


http://imageshack.us/photo/my-images/41/clearclipboard.png/



on run {input, parameters}



tell application "System Events" to set the clipboard to ""


return input

end run


Save the scrip and drop it in your User/Library/Services folder and like magic the Clear Clipboard option will be under your File/Services menu.


What I would like to see a Clear Clipboard tool added to the Mail toolbox; however, I can live with the Services/Clear Clipboard.


I hope this tip is useful.

Posted on Aug 25, 2011 2:39 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 26, 2011 11:16 AM

User uploaded file

20 replies

Mar 22, 2014 9:08 AM in response to aRKay

Wouldn't that still be a string on the clipboard, even it it is an empty string? Then many applications would still let you paste that empty string (Paste menu item would be enabled.)


tell application "System Events" to set the clipboard to null


After that, Finder>Edit>Show clipboard pronounces the contents of the clipboard as "unknown". IOW, no mimedata and unknown mimetype.

Mar 22, 2014 3:32 PM in response to aRKay

You're right, I should have tried it first.


You're wrong, it works as I discussed. After >echo "" | pbcopy , Finder>Edit>ShowClipboard says there is 'text' on the clipboard, and an application I am writing has Paste enabled, and if you choose it, it pastes empty text. Maybe my app should not paste empty text, but my point is, the OS tells the app there is mimedata of mimetype 'text' on the clipboard.


Of course if another application doesn't handle mimetype text, then having empty text on the clipboard is the same as having nothing on the clipboard, to that application. But there is a subtle difference, at least to programmers.

Aug 26, 2011 11:09 AM in response to baltwo

Disregard my comment about the AppleScript Editor not letting me type or paste anythhing. I had a bad boot. I quit and restarted the editor and the tip worked great. I now have Clear Clipboard on the dock that can be used the next time the clipboard need to be cleared.


Thanks... I now have two ways to clear the clipbard

Aug 26, 2011 11:32 AM in response to Marc Wilson

> You do realize that simply copying a new item displaces

> the old contents of the clipboard, right?


Yes, that is the way the Finder is designed to work. However, for some reason it does not always work correct. When a new COPY fails to clear the clipboard is when I need to use the Services/Clear Clipboard or the receently added Clear Clipbard on the dock.


I find it hard to understand that I am the only person with this isseu.

Mar 22, 2014 3:43 PM in response to bootchk

My main concern is having a clipboard emtpy of any passwords or sensitive data I may have copied to it last. What you wrote is mostly over my head, but are youi saying there is effectively no recoverable information in the clipboard after running that command or not? I am seeing "clipboard contents: text."

Mar 23, 2014 5:17 AM in response to WZZZ

Oh, we have different concerns. I am mostly concerned about when Paste is enabled.


Your method WOULD effectively eliminate sensitive information from the clipboard.


But can you even Copy a password (when it is displayed as *** in a password field)? My guess is the OS would not put the password on the clipboard, just the '***'. Which is not the same as the password itself. If users save their passwords in 'plain text' in a document so they can copy and paste them into password fields, then yes, I suppose the password could be on the clipboard. But I think most people recommend you not keep your passwords in plain text on your computer. Only written in pencil on your monitor.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to Clear the Clipboard - A Finder Annoyance

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.