Title: Re: Moving mailbox
On or near 2/12/01 6:43 PM, Mark A. Gregory at
[EMAIL PROTECTED] observed:

> Hi,
>
> I have been reading about how to move mail folders and the messages they
> contain to a IMAP folder on an exchange server.
>
> I cannot identify the script that I'm meant to use to "repair" the mail
> folders after they are dragged to the desktop.  I understand that I can then
> drag the mail folder to the IMAP folder on the exchange server and viola I'm
> done.
>
> I tried the fix mbx script version 2.0 but it failed.  I assume that this is
> the wrong one?
>
Failed how? That's my script and it is the right one.

If it failed with a message with a message something like:

>   Can't make "Mac OS 9.1:Desktop Folder:Macintosh20010212.mbx" into a item
>
then maybe I can help. I just answered another person with this problem as follows:

I suspect that I relied in error on a type coercion that happens automatically on my system because of some other osax, like Jon's Commands. In the line you gave, try adding "file" in front of the variable "newName" and see if that works.

I discovered that when I did this, I needed to put the following IF block inside a "tell finder" block, like this:

        set newFile to open for access file newName with write permission
        tell application "Finder"
            if (file type of x) is "TEXT" or (file type of x) is "MBOX" then
                set fileRef to open for access aFile without write permission
                set atEOF to false
                repeat while not atEOF
                    try
                        set t to read fileRef for 10000
                    on error
                        set t to read fileRef to eof
                        set atEOF to true
                    end try
                    set t to my SearchReplace(t, "From ^^^@^^^", newDate)
                    write t to newFile
                end repeat
                close access fileRef
                close access alias newName
                my setTypes(alias newName)
            end if
        end tell

>
I don’t know for certain why I needed the tell block, but it works that way, while without it, the script said it could not get the “file type” of “x”, which should be a record of file info. Apparently, though, the script was interpreting “file type” as something referring to an actual file and not a field in a record of file information.

--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage: <http://homepage.mac.com/allenwatson/>

Reply via email to