Title: Re: Please help: "Extract message from digest" script not working in Entourage 2004
Nothing's wrong with it. And you're not reporting what "doesn't work".

Do you keep the Scrapbook open in 2004? Or is the Dictionary window open? Or Progress Window? If so, that's now the front window and will get in the way of the message window.

A good way to debug scripts to to remove all the user-friendly error traps, so an error is highlighted during script run. But I suspect you're not getting errors, merely not getting the 'class of theWindow' as you'd expect, or possibly no selection. You should get the free editor Smile which lets you step through  a script line by line and see where it's taking a wrong turn.

If you have the Scrapbook open, close it and run the script.

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

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



From: HAV <[EMAIL PROTECTED]>
Reply-To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Date: Tue, 25 May 2004 06:30:41 -0400
To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Subject: Please help: "Extract message from digest" script not working in Entourage 2004

I would be much obliged if someone can help me. This script works in Entourage X but not 2004. I can not find what’s wrong with it. I use it all the time to save individual messages from a digest :(

Thanks,

Hank
------------------------

on maybeExtract(theWindow, theSelection)
    tell application "Microsoft Entourage"
        set theMessage to the displayed message of theWindow
       try
           set theAccount to the account of theMessage
       on error
           set theAccount to ""
        end try
       set theFolder to the storage of theMessage
       try
           if theAccount is not "" then
               make new incoming message with properties ¬
                    {source:theSelection, read status:untouched, account:theAccount} at theFolder
           else
               make new incoming message with properties ¬
                    {source:theSelection, read status:untouched} at theFolder
           end if
       on error
           display dialog "Message extraction failed" buttons {"OK"} default button {"OK"}
        end try
   end tell
end
maybeExtract

on run
   tell application "Microsoft Entourage"
        set theSelection to the selection
       if the class of theSelection is string then
           set theWindow to the front window
           if the class of theWindow is message window then
               my maybeExtract(theWindow, theSelection)
            else if the class of theWindow is draft window then
               display dialog "Text in a message must be selected." buttons {"OK"} default button {"OK"}
            else if the class of the displayed feature of theWindow is folder then
               my maybeExtract(theWindow, theSelection)
            else
               display dialog "Text in a message must be selected." buttons {"OK"} default button {"OK"}
            end if
       end if
   end tell
end
run

Reply via email to