clipboard

How do I clear my clipboard? There is something on it from a previous copy and paste, and I can't get rid of it. So everytine I try to cut and paste, the old cut gets pasted. Help!

iMac (2017 – 2020)

Posted on Jun 10, 2023 08:49 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 10, 2023 09:08 AM

Launch the Terminal and at the prompt, enter the following to clear the main clipboard:


pbcopy <<<""

or AppleScript copy/pasted into Script Editor, click compile and run:


use framework "Foundation"
use AppleScript version "2.4" -- Yosemite 10.10 or later
use scripting additions

property ca : current application

set pb to ca's NSPasteboard's generalPasteboard()
pb's clearContents()
return



You can even save this as a double-clickable script or application to your Desktop when you want to quickly clear the clipboard.



6 replies
Question marked as Top-ranking reply

Jun 10, 2023 09:08 AM in response to bobmono

Launch the Terminal and at the prompt, enter the following to clear the main clipboard:


pbcopy <<<""

or AppleScript copy/pasted into Script Editor, click compile and run:


use framework "Foundation"
use AppleScript version "2.4" -- Yosemite 10.10 or later
use scripting additions

property ca : current application

set pb to ca's NSPasteboard's generalPasteboard()
pb's clearContents()
return



You can even save this as a double-clickable script or application to your Desktop when you want to quickly clear the clipboard.



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.

clipboard

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