1. If you're careful to keep your open reply message in front of any other
new messages you're composing, then you can find it like this:

    set replyWindow to name of first window whose class is draft window


2. You can ensure that you're not going to com adrift when you select text
(hopefully) in another (received) message and start the script:

        try
            set selectedText to the selection
            if class of selectedText is not Unicode text or selectedText =
"" then error number -128
        on error
            beep
            display dialog "You haven't selected any text!" buttons
{"Cancel"} default button 1 with icon 0
            return
        end try


3. You can add selected text from your currently selected (received) message
at the insertion point  in reply Window like this:

    select replyWindow -- brings to front
    set selection to selectedText


For some reason, 'select' meaning 'bring to front' is not in the Dictionary.
'selection' is, but doesn't help much

    selection anything  -- The selection visible to the user.

It can mean a lot of different things, as can setting selection, here it
means setting text in an editable text window.



-- 
Paul Berkowitz
MVP Entourage


PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.



------

tell application "Microsoft Entourage"

    try
        set replyWindow to first window whose class is draft window
    on error
        beep
        display dialog "You need to have begun a new reply or new message
before running the script." buttons {"Cancel"} default button 1 with icon 0
        return
    end try
    
    try
        set selectedText to the selection
        if class of selectedText is not string or selectedText = "" then
error number -128
    on error
        beep
        display dialog "You haven't selected any text!" buttons {"Cancel"}
default button 1 with icon 0
        return
    end try
    
    select replyWindow -- brings to front
    set selection to selectedText
end tell

-------------------



-- 
Paul Berkowitz
MVP Entourage


PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.



> From: Gary <[EMAIL PROTECTED]>
> Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
> Date: Sun, 10 Nov 2002 02:20:15 -0500
> To: Entourage-Talk <[EMAIL PROTECTED]>
> Subject: E2K1: Reply-related Script Assistance
> 
> Hello everyone.  Hoping to catch a late-nighter like myself...
> 
> Caveat emptor:  I am not a scripting wizard.  I wish, on many days, to be
> able to write E applescript like PB and AW on this list, but, alas... ;)
> 
> Mostly I can search for and find a script to do what I want, or that I can
> follow enough to modify.  In this case, after 2 days of searching, I can't
> find such a beast.  Sometimes, my idea is so smashing that I just can't
> imagine not being able to do it. Which is, in fact, part of the beauty of
> AS.
> 
> So, I thought I would be seeking scripting assistance, but now I might just
> as well be making a script request.  Although, I'd really like to be able to
> finish this puppy on my own, I'd rather have a functioning script!
> 
> Here's what I have been trying do (for far longer than is prudent  <8-)~
> 
> I call my script project:  Reply Into
> 
> 
> When I reply to some lists, I like to reference more than one person's
> previous post, so I have to first hit reply, then go back to another
> message, copy some text, then go back to the newly started reply, paste as
> quotation, and then repeat this process as many times as needed. This
> produces a reply that might look like:
> 
> On 11/10/02 This Person (thisperson @ here.com) said:
> 
>>  blah blah blah blah
> 
> And
> On 11/09/02 That Person (thatperson @ there.com) said:
> 
>> here we go 'round the mulberry bush
> 
> 
> Selecting some text and replying already does the first part, and leaves my
> cursor at the bottom of the page, after the reply-inserted text (in this
> case, after the last 'blah').
> 
> What I can not get to happen via AS is to have my reply script insert the
> selected text into the bottom of the already open message, using the same
> Attribution format from my settings, or even a script-concocted attribution
> to add something like "and also, "
> 
> I had much trouble finding the open window via AS, but after an hour with
> the Entourage AS guide, I've got that mostly working (not pretty ;). I just
> loop through windows until I find the first message that is an outgoing
> message.
> 
> LIMITATION to my method:  If I have more than one open outgoing message,
> well, I'm done for.
> 
> My 'thinking' was that:  if I started the whole process with a Reply-To
> script instead of E's reply, THEN I could actually know a window number for
> the newly created outgoing message, and I could reference that number in
> subsequent scripts.
> 
> Somewhere around 10PM EST, I abandoned that effort upon realizing that I had
> also, at one point in my life, envisioned building an all-cheese car.
> 
> If anyone can offer a simple method to:
> 
> a) find my open outgoing message window more elegantly and less
> "accidentally" (i.e., by starting the whole process off with a reply script,
> so the window can be directly referenced later)
> 
> b) force my AS-generated 2nd, 3rd, etc. replies into the already open
> message
> 
> ...I would be very grateful, and I'd be able to give up my cheese-mobile
> dreams completely.
> 
> I would be happy to offer my finished script to the list and others, as I
> think it's a very useful script idea that I wasn't able to find already out
> there.
> 
> Thanks very much for any ideas, pointers, references and the like.
> 
> Over and out,
> 
> Gary
> 
> 
> -- 
> To unsubscribe:  
> <mailto:Entourage-Talk-Off@;lists.letterrip.com>
> archives:       
> <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
> old-archive:     
> <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>
> 


-- 
To unsubscribe:                     
<mailto:Entourage-Talk-Off@;lists.letterrip.com>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to