PDA

View Full Version : Applescript Copy Paste Help!




peleus
Jun 17, 2008, 03:22 PM
Hi All,

This is probably a very simple solution but my best efforts are not good enough to figure this one out. Does anyone know the general form of how to copy and paste in applescript. I am trying to copy text from a txt file into the body of a new message in entourage mail. I can open the text file, and even open a new mail message in applescript. Reading the manuals and dictionaries are confusing since I am not even sure which command is appropriate, get, set, duplicate, or none of the above.

Thank you all for your help



numero
Jun 21, 2008, 04:52 AM
Look at http://www.macosxhints.com/article.php?story=20080207080505152

Pay attention to:
tell application "System Events" to keystroke "c" using {command down}
tell me to activate
set selecTxt to the clipboard as text

Springsky
Sep 26, 2008, 06:55 PM
where do I ask a question?

mysterytramp
Sep 27, 2008, 07:16 AM
And you might not need to use the clipboard either. Put the text into a variable, then set the appropriate container in Entourage to that variable.

I googled Entourage and Applescript and found an article at MacTech. Here's a code snippet that might help get you started:

set theSubject to "Some Subject"
set theBody to "Some Body"
tell application "Microsoft Entourage"
make new outgoing message with properties
{subject:theSubject, content:theBody}
end tell
--> outgoing message id 11285 of application "Microsoft Entourage"


mt