How do I export the clipboard?


I have a very long script that at some point says:
set the clipboard to x
Unfortunately the clipboard is only available to the Finder and cannot be pasted into a Micrsoft word document, for example (or into an application’s “Go To” dialog box, which is what I am trying to do). Any suggestions how I could make the clipboard available system wide? I tried this:

on setTheClip(foldername)
set the clipboard to foldername
end setTheClip

but it has the same problem. Any other suggestions? Should I post the whole script? It is extremely long.

Thank you very much for your suggestions


One typically needs to “activate” the application before both getting and setting the clipboard. Jon Pugh calls this “slamming the clipboard”.

tell application "First Application"
	set str to the clipboard
end tell
tell application "Second Application"
	set the clipboard to str
end tell