Re: Talking to IMAP folder in Entourage
Re: Talking to IMAP folder in Entourage
- Subject: Re: Talking to IMAP folder in Entourage
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 06 Apr 2010 11:59:36 -0700
- Thread-topic: Talking to IMAP folder in Entourage
Title: Re: Talking to IMAP folder in Entourage
On 4/6/10 10:24 AM, "Beatrix Willius" <email@hidden> wrote:
I've tried some variations:
tell application "Microsoft Entourage"
set theFolders to get folders of IMAP account 2 --gives all folders
set theAccount to IMAP account "Imap moth" -- this is the id 2
set theFolder2 to folder 9 of theAccount -- this is "test mailbox
set theName to name of theFolder2 - really "test milbox"
set theFolder to folder "test mailbox" of IMAP inbox folder of IMAP account "Imap moth" --doesn't work
end tell
OK, I tested, and yes, you're right: there's a genuine problem, which has a workaround. It can't really be called a bug, because it's documented (though hidden), but it's poor implementation. I'll explain.
There are actually two issues. One is that you need the explicit 'get'. I.e.
every folder of IMAP inbox folder of IMAP account "Imap moth" --{}
name of every folder of IMAP inbox folder of IMAP account "Imap moth" -- error
But:
every folder of (get IMAP inbox folder of IMAP account "Imap moth") --{full list of folders here}
name of every folder of (get IMAP inbox folder of IMAP account "Imap moth") -- {"test mailbox", etc., etc.}
The second thing is that now you cannot get IMAP subfolders by name! I don't know when thus happened, probably Entourage 2008. It's bad, and breaks earlier scripts, since this used to work. In Script Editor 2.0, i.e. since Tiger, (and presumably AppleScript Editor in Snow Leopard, but I don't know since I don't have it) Dictionaries no longer tell you how elements of classes may be specified, as they used to in the old Carbon Script Editor. 1.0 But Script Debugger still shows these. For IMAP account class and 'folder' class, it shows that (sub) folders within can only be specified by index (1, 2, 3, etc.) and by whose filter. Not by name! Now, it says the same thing for local folders, but by name still works there, as you know: 'folder "Test" of folder "Inbox"'. But for IMAP folders, it does not! Therefore you must refer to the Inbox of an IMAP account as 'IMAP inbox folder of IMAP account "Whatever"' - you can't say 'folder "INBOX" of IMAP account "Whatever", andf you can't get subfolderrs by name at all. Except that whose filters do work, so you have to do this:
first folder of (get IMAP inbox folder of IMAP account "Imap moth") whose name is "test mailbox"
Try that.
I'll report it as an implementation mistake, but since they must be working on the next version of Office now (the email program will be called Outlook), it's not very likely to be changed in Entourage 2008, since strictly speaking, it's not a bug. Maybe it can be made to work better, with IMAP folders specified by name, in the new thing. It used to work, back in Entourage 2004 and earlier.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden