Title: Re: Applescript send now
on 12/9/04 10:04 PM, Scott Haneda at [EMAIL PROTECTED] wrote:

> Stuck here a bit:
>
>     set MyMessage to make new outgoing message with properties ¬
>         {recipient:"[EMAIL PROTECTED]", subject:"admin", content:theBody}
>     -- send it
>     send MyMessage
>
> Never sends my message, it just sits in the outgoing queue until my schedule
> picks it up.  How can I make it send it right now?

I have gotten a little more into this:
All works well, with the problem that it can not delete MyMessage, AS gives me a error about not being able to locate it.??

tell application "Microsoft Entourage"
    -- get the first current message - will be a filtered message when script is run from a rule
   set theMess to item 1 of (get current messages)
    -- get the body of the message
   set theContent to content of theMess
   --preserve the TIDs and assign the new ones
   set {oldTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "unsubscribe"}
    -- get the parts of the message separated by "unsubscribe"
   set newContent to text items of theContent
   -- set the replacement text
   set AppleScript's text item delimiters to {"unsubscribe all"}
    
    set theBody to "line 1" & return & "line 2" & return & (newContent as text)
    
    -- reset the saved TIDs so we leave everything as we found it
   set AppleScript's text item delimiters to oldTIDs
   
    -- set fwdMessage to forward theMess to "[EMAIL PROTECTED]" without opening window and html text
   set MyMessage to make new draft window with properties ¬
        {recipient:"[EMAIL PROTECTED]", subject:"admin", content:theBody}
    -- send it
   send MyMessage
   
    -- now, wait until it has finished sending
   repeat while connection in progress
       delay 2
    end repeat
   -- and tidy up again
   delete {theMess, MyMessage}
end tell
--
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
<http://www.newgeo.com>                     Fax: 313.557.5052
<[EMAIL PROTECTED]>                          Novato, CA U.S.A.

Reply via email to