AppleScript - paste into message window

C

Charles Howse

Hi,
I have an AppleScript that copies a line of text to the clipboard, and I'm
looking for a way to paste that into a message.

Looking at the Entourage Dictionary in AppleScript, it looks like Entourage
doesn't support 'paste'.

Is there some workaround or hack so that I can run my script, and have it
paste the contents of the clipboard into the message?

Thanks,
Charles
 
C

Charles Howse

Hi,
I have an AppleScript that copies a line of text to the clipboard, and I'm
looking for a way to paste that into a message.

Looking at the Entourage Dictionary in AppleScript, it looks like Entourage
doesn't support 'paste'.

Is there some workaround or hack so that I can run my script, and have it
paste the contents of the clipboard into the message?

OK, sorry to reply to my own post, but I've solved this.
Here's the script...

do shell script "/Users/Charles/bin/sig.sh"
tell application "Microsoft Entourage"
tell application "System Events"
tell process "Microsoft Entourage"
click menu item "Paste" of menu "Edit" of menu bar item "Edit"
of menu bar 1
end tell
end tell
end tell
 
P

Paul Berkowitz

OK, sorry to reply to my own post, but I've solved this.
Here's the script...

do shell script "/Users/Charles/bin/sig.sh"
tell application "Microsoft Entourage"
tell application "System Events"
tell process "Microsoft Entourage"
click menu item "Paste" of menu "Edit" of menu bar item "Edit"
of menu bar 1
end tell
end tell
end tell

But this method doesn't involve "hacks" like GUI scripting. Check Standard
Additions dictionary for 'the clipboard':

do shell script "/Users/Charles/bin/sig.sh"
tell application "Microsoft Entourage"
activate
set selection to the clipboard
end tell


As with your script, it only works with a text window of some sort (new
message window, notes section of event, task, most fields of a contact
window, or a note) in the front, and should have some error trapping for
that condition.

This method is more reliable than GUI scripting.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
Top