Title: Re: AppleScript - Start Afresh
Yes, it makes sense.

In earlier versions of Mac OS (classic versions) there was a sort of hack (it was really a bug) that let you

    save theMsg in digestFolder

i.e. specify the folder (container) for the file you wanted to create. The proper way is to specify the file specification (the full path) of the file-to-be. In OS X, the hack method errors instaed of working. What you want is to replace that line with the following:


    save theMsg in (digestFolder & s) as "TEXT"


But there will still be a problem if the subject of the message contains a colon. . Also, just in case your startup disk's name has an accent or other "special: character, you should replace the first line of the script. Finally, you should not be using the Documents folder on the root of your hard disk now that you're in OS X, but rather the Documents folder in your user folder (the one that shows up as "Documents" in the left bottom column). Do first move your "Digests" folder there. (Otherwise the script will make a new Digests folder for you there.) Then the following script will work:




property digestFolder : ""

set digestFolder to ((path to documents folder as Unicode text) & "Digests:")

try
   get alias digestFolder
on error
   tell application "Finder" to make new folder at (path to documents folder) with properties {name:"Digests"}
end try

tell application "Microsoft Entourage"
    set currentMessages to the current messages
   repeat with theMsg in the currentMessages
       my ProcessMsg(theMsg)
    end repeat
end
tell

on ProcessMsg(theMsg)
    tell application "Microsoft Entourage"
        set s to subject of theMsg
       set s to my ReplaceColons(s)
        if (s contains "digest") and (s does not start with "Re-") then
           save theMsg in (digestFolder & s & ".txt") as "TEXT"
            set read status of theMsg to read
           move theMsg to deleted items folder
       end if
   end tell
end
ProcessMsg

to ReplaceColons(s)
    set AppleScript's text item delimiters to {":"}
    set chunks to text items of s
   set AppleScript's text item delimiters to {"-"}
    set s to chunks as Unicode text
   set AppleScript's text item delimiters to {""}
    return s
end ReplaceColons



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

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


> From: bobgir2004 <[EMAIL PROTECTED]>
> Reply-To: "Entourage:mac Talk" <[email protected]>
> Date: Sun, 26 Jun 2005 16:14:13 -0400
> To: Entourage-Talk <[email protected]>
> Subject: AppleScript - Start Afresh
>
>     After a considerable search, I found the original of the Script  which
> suddenly began giving me trouble.
>
>     It was at <http://scriptbuilders.net/search.php> and it is called <Saved
> Digests to Text>.
>
>     In it's virgin form, here is how it reads:
>
> **********
> property digestFolder : ""
>
> set digestFolder to ((path to startup disk) as string) &
> "Documents:Digests:"
> tell application "Microsoft Entourage" --
>     set currentMessages to the current messages --
>     repeat with theMsg in the currentMessages --
>         my ProcessMsg(theMsg) --
>     end repeat --
> end tell --
>
> on ProcessMsg(theMsg) --
>     tell application "Microsoft Entourage" --
>         set s to subject of theMsg
>         if (s contains "digest") and (s does not start with "re") then
>             save theMsg in digestFolder as "TEXT"
>             set read status of theMsg to read
>             move theMsg to folder "Deleted Items"
>         end if
>     end tell --
> end ProcessMsg --
> *********      
>
>     What it was doing for me was this - when I highlighted an incoming
> Digest from any of the three Lists to which I subscribe, this script would
> transform the incoming Digest into a TextEdit document, move that document
> to a folder on my desktop called Digest Viewer, and move the incoming Digest
> email to the Deleted Items folder of Entourage.
>
>     Does that help?
>
>     Now, using the above script, when I run it on an incoming Digest I
> receive this alert message:  <Microsoft Entourage got an error: item 1 of
> {incoming message id 9020} doesn't understand the save message.
>
>     Does this help anyone figure out why this won't do what it once did?
>
>     Many thanks for all the help I have received,
>     Bob
>
>      
>
>
> --
> 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/>
>
>

Reply via email to