Clipboard
Is there a way to clear the clipboard?
Is there a way to clear the clipboard?
If you don't mind launching the Terminal, and typing, then dialabrain's solution is a concise way to clear the clipboard. If you want to double-click a file on the Desktop to do exactly the same thing, without having to launch Terminal yourself, then you can use a Terminal command file.
Place the following code in a text file on your Desktop named clipCLR.command. Make it executable by you.
#!/bin/zsh
# clear the clipboard
pbcopy < /dev/null
exit
When you double-click this clipCLR.command file in the Finder, it will instantly launch Terminal, run this script, and exit the Terminal. The clipboard is cleared. It would also work with Bash as the shell instead of Zsh.
If you don't mind launching the Terminal, and typing, then dialabrain's solution is a concise way to clear the clipboard. If you want to double-click a file on the Desktop to do exactly the same thing, without having to launch Terminal yourself, then you can use a Terminal command file.
Place the following code in a text file on your Desktop named clipCLR.command. Make it executable by you.
#!/bin/zsh
# clear the clipboard
pbcopy < /dev/null
exit
When you double-click this clipCLR.command file in the Finder, it will instantly launch Terminal, run this script, and exit the Terminal. The clipboard is cleared. It would also work with Bash as the shell instead of Zsh.
The clipboard is a "magical" place = in RAM (or scratch disk)
It keeps only ONE THING at a time - if it is a LARGE thing, it likely is a reference TO the original
test this by copying an image from a file on your Mac, then Trashing (and EmptyingTrash) the file before you PASTE (I cannot test, no Mac working now)
MUCH MUCH easier to clear it is copying OVER whatever you are worried about lurking there with a single character " § " 😁
Why would you need to? A large image or pages & pages of text on it ?
What device, OS & version?
Copy a single character to make it small = " . " for example.
Restarting the device will clear it
No idea why one would bother but run this command in the Terminal…
pbcopy < /dev/null
Works fine on Catalina 10.15.3 and Mojave 10.14.6 for me with the Terminal closing (and quitting). Using identical Terminal profiles and settings on both which I verified just to be sure. More Apple intrigue. 🤬
The following Applescript will zap the clipboard contents too:
set the clipboard to white space
VikingOSX wrote:
Works fine on Catalina 10.15.3 and Mojave 10.14.6 for me with the Terminal closing (and quitting). Using identical Terminal profiles and settings on both which I verified just to be sure. More Apple intrigue. 🤬
The following Applescript will zap the clipboard contents too:
set the clipboard to white space
How BIG (filesize) is "white space" ?
Is it "text" (spacebar space)
Enquiring Minds Want to KNOW!
The white space class is a null constant as far as I can tell. The following command does not pass anything (e.g. text) on the clipboard to hexdump after the AppleScript command. Not even a ubiquitous newline.
pbpaste | hexdump -C
Device - MacBook Air (13-inch, Early 2014) running Mac OS Catalina 10.15.3.
Its just when I'm typing - cutting and pasting, it would be nice to know where the clipboard is so I can clear it.
Just for jollies I created the file. For some reason the Terminal doesn't close. Me no like scripts.
Beats me. The file launches the Terminal, runs the command then doesn't exit. It's fine though, in 30+ years I haven't had a need to clear the clipboard.
I have never needed to clear the clipboard in all that time either. Who pressed that fast forward button…
(not) "anything" = nothing = smaller than something 🏴☠️😎
A Texas null, then.
Thank you. That worked :D
Clipboard