Way to insert automator output at the cursor

automator

I have a simple script that generates different output every time it's run (e.g. generate a UUID).

Is there a way to write an automator script that simply inserts the output of a script at the current cursor location?

(I want to run this service from Thunderbird, if that makes a difference.)

Best Answer

Could your automator script copy the output to clipboard and then run this script to paste the clipboard contents?

do shell script "pbpaste > /path/to/your/clipboard-file.txt"

This topic covers the paste function in more detail https://stackoverflow.com/questions/9976338/applescript-to-paste-text-from-clipboard-into-a-file