Applescript Clipboard Confusion

Hi,
I am trying to write a simple applescript that allows you to see the clipboard as a dialog and set it to " " (clear it).
So far I have:

set theText to (the clipboard)
display dialog theText buttons {"Clear Clipboard", "Ok"} default button 2
if button returned of the result = "button 1" then tell application "Finder" to set (the clipboard) to " "

but the script doesn't set the clipboard to " " at all - it just leaves it alone,
Help wanted for confused amateur!

MacBook Pro, Mac OS X (10.6.2)

Posted on Nov 23, 2009 3:27 PM

Reply
6 replies

Nov 24, 2009 9:51 AM in response to red_menace

red_menace wrote:
Basically "the clipboard" is one of those artifacts of an earlier age that had a reason at the time but now is just weird.


what you meant to say, I think, was {color:blue}Basically "the clipboard" is one of those artifacts +of applescript nomenclature+ of an earlier age...{color}. some version of clipboard functionality is (of course) fundamental to any kind of copy/paste operation.

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.

Applescript Clipboard Confusion

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