Thanks, Paul,
For getting me on the right track. I got the script working (except for the
cursor location), thanks to your advice, and used it for this message! All
it really does is insert a couple of blank lines and a simple signature
above the quoted text. I may go back and update it to work on saved drafts,
but since this is the first step I do in any reply, it's unlikely I'd ever
need that. Here's the script:
---
tell application "Microsoft Entourage"
set w to window 1
if w is {} then
return
end if
if class of w � draft window then
return
end if
set signature type of w to none
set s to content of w
set intro to (ASCII character 13) & (ASCII character 13) & �
"Rick" & (ASCII character 13) & "=====" & (ASCII character 13) & �
(ASCII character 13)
set s to intro & s
set content of w to s
end tell
---
I added "\cI" to the file name so I just begin each reply with Ctl-I and
Cmd-Home and start typing. Again, thanks for the advice!
Rick
=====
On 6/30/02 6:25 PM, "Paul Berkowitz" <[EMAIL PROTECTED]> wrote:
> On 6/30/02 4:03 PM, "Rick Johnson" <[EMAIL PROTECTED]> wrote:
>
>> I'd like to try my first Entourage X AppleScript, but I'm not sure if what I
>> want to do is practical, or even possible.
>>
>> If the current window is an outgoing message, I'd like to do two things:
>
> Windows aren't messages. They ay be displaying messages and/or they may be
> 'draft windows': unsaved new message windows..
>>
>> 1) Insert predefined text at the cursor location and move the cursor to the
>> beginning of the inserted text. "source of message" seems it should return
>> the text of the message, but is there a way to get or set the cursor
>> location?
>
> 'source' is not what you want here. You can insert text at the cursor
> location in a draft window (previously saved draft messages can be re-opened
> as draft windows too):
>
> if class of window 1 is draft window then
>
> set selection to "Some new text here. "
>
> end if
>
> But no, there is mo way at all to reset the cursor location. you could do I
> in Entourage 2001 with the use of suitable scripting additions (Sigma's
> Additions, for example) but these don't exist or work in OS X. Yes, perhaps
> with QuicKeys you could record yourself typing command-up arrow, which will
> do it (and which you could emulate with Sigma's, Sandi's or Akua).
>>
>> 2) Change the signature to "None."
>
> That's easy enough:
>
> set signature type of window 1 to none
>
> Only works for draft windows, so include it in the 'if' clause. (If you ever
> send news messages, then that first line should be instead:
>
> if {class of window 1} is in {draft window, draft news window} then
>
> set selection to "Some new text here. "
> set signature type of window 1 to none
>
> end if
>
>
> If you save window 1, it becomes an outgoing message, and you can access
> various message properties this way:
>
> save window 1 -- saves in drafts folder
> set theMsg to displayed message of window 1
> -- close window 1 saving yes -- alternate possibility
>
> or you may not need to do that all. Just
>
> send window 1
>
>>
>> I've written a few scripts for the Finder and Adobe Illustrator, but I seem
>> to be at a loss with this one. I'd appreciate any suggestions, even if it's
>> just to buy QuicKeys.
>>
>
>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
archives: <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive: <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>