Re: AppleScript - paste into message window
- From: Paul Berkowitz <berkowit@xxxxxxxxxxxxxxxx>
- Date: Sat, 12 Nov 2005 08:32:28 -0800
On 11/12/05 5:26 AM, in article BF9B4995.2096%me@xxxxxxxxxxx, "Charles
Howse" <me@xxxxxxxxxxx> wrote:
> On 11/12/05 6:46 AM, in article BF9B4049.1F64%me@xxxxxxxxxxx, "Charles
> Howse" <me@xxxxxxxxxxx> wrote:
>
>> 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
>
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.
.
- References:
- AppleScript - paste into message window
- From: Charles Howse
- Re: AppleScript - paste into message window
- From: Charles Howse
- AppleScript - paste into message window
- Prev by Date: Re: Time zone affecting scheduled events
- Next by Date: Re: Time zone affecting scheduled events
- Previous by thread: Re: AppleScript - paste into message window
- Next by thread: groups/distribution lists on exchange server not showing up
- Index(es):
Relevant Pages
|