MacOS – Safari saves random files to Desktop in Mountain Lion

desktopmacosmousesafari

Sometimes, when I leave Safari (6.0.5) and look at my desktop, I find random files on it. These are always in the form of a *.textClipping file, or in the case of images, the original filename and extension.

For example, yesterday when I signed up for Stack Exchange, I found a file named with some hex and a png extension on my desktop. This was actually my Stack Exchange/Gravatar identicon.

This issue seems to have started when I got my Magic Mouse. It reflects the behavior of dragging selections or images to the desktop, so I think that something to do with the mouse is probably the cause.

Is there any way to disable the dragging behavior in Safari? Any ideas on why exactly it's being triggered?

Best Answer

The .textClipping files are text that you've dragged out of an app to a folder location (in this case, the Desktop).

You can increase the delay required to drag a clipping using the following command:

defaults write -g NSDragAndDropTextDelay -int 10000

-g applies to all apps. To only apply to Safari, replace -g with com.apple.Safari.
Default delay is 1000 milliseconds (1 second).

To completely disable the ability to drag clippings, set the value to negative.

defaults write -g NSDragAndDropTextDelay -int -100