Clipboard Blues

I’m a newbie when it comes to applescripting, so if the answer to this question is really simple, please bear with me. I’ve searched high and low, but have so far been unable to find any answer to my question, which is:

How do I pass a simple string to the clipboard?

What I want to do is create a little app that has a few buttons, and each of these buttons has a string attached to it. So, when I click one of the buttons, I want to the string from that button to be put in the clipboard for me to paste elsewhere.

I’ve got everything down, except the clipboard part, and I just can’t seem to find a solution. The obvious ones:


set clipboard to myString as string

or


copy myString to clipboard

… both result in the following error “Can’t make clipboard into type reference. (-1700)” :confused:

Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)

You almost had it. For the clipboard, you actually need to use [the]:

set myString to "Hello There!"
set the clipboard to myString

Wooooooo! It worked! Thanks so much.