Pasting Fortune from Clipboard

Hi All,

This is probably obvious, but I haven’t been able to find a solution. I am using this script to produce Email Signatures. I am not using one that creates a new email with the sig because I am usually replying to another email.

	set f_text to (do shell script "sw/bin/fortune -s ~/library/bin/")
	display dialog ¬
		f_text with icon 1 ¬
		with title ¬
		"Send Fortune to Clipboard?" buttons {"Cancel", "Next", "OK"} ¬
		default button "Next"
	if button returned of result is "Cancel" then
		display dialog "Cancel"
		exit repeat
	else if button returned of result is "Next" then
		set the clipboard to "
" & f_text
		exit repeat
	end if
end repeat

What I would like to be able to do is that instead of pasting the fortune manually after I select Ok, it automatically pastes into the active window (the mail compose window).

Anyone have a few hints for me?

Thank you in advance.


take a look at this article.
Hope it helps.