How do I export the clipboard?

Hi,

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

Ken

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"
	activate
	set str to the clipboard
end tell
tell application "Second Application"
	activate
	set the clipboard to str
end tell