• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: need a fix in this entourage script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need a fix in this entourage script


  • Subject: Re: need a fix in this entourage script
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 21 May 2002 08:51:39 -0700

On 5/21/02 7:27 AM, "Jean-Baptiste Le Stang" <email@hidden>
wrote:

> You might try the following script but there is surely a better way to do
> it.
> You're also trying to increase the id of your folders 1 by 1 which is not
> the case, that's why I have an handler dedicated to making the list of the
> id of every folders
>
> Jean-Baptiste LE STANG
>
>
> global pidlist
> global umc
> set umc to 0
>
> tell application "Microsoft Entourage"
> set IdOfFolders to ID of every folder

That will start you out with only LOCAL folders ('every folder' just gets
you local top-level folders). You will not find out anything about IMAP or
Hotmail folders that way. You also need to get 'every IMAP account', and
tell each of those accounts to get 'ID of every folder' of itself, and the
same with Hotmail accounts.

The idea of then checking top-level folder IDs for subfolders in a recursive
handler is the right way to go. Just trying indices (set n to count (every
folder), get folder i from 1 to n) is also OK. What you want to avoid is
testing for hypothetical 'folder id x' when you don't know if x exists.
There was a bug I reported somewhere in the beta process where that would
crash, even in a try block. It was fixed to error instead of crash, but I
can't recall if it was fixed in the release version or if that fix is still
to come.

Another thing to be careful of is the 'repeat with x in someList' format. In
Entourage

repeat with x in (every someAppObject)

always works well, but here you have an (AppleScript) list of numbers, not
of Entourage application objects. It's usually safer to use

repeat with i from 1 to (count someList)
set x to item i of someList

so you don't hit the non-evaluating item problem with AppleScript lists.
Perhaps the 'x in every' is OK in this case - one never knows. (You could
also calculate the unread counts as you go along instead of going through
the master list at the end.)

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: need a fix in this entourage script (From: Jean-Baptiste Le Stang <email@hidden>)

  • Prev by Date: CompileAndExecute
  • Next by Date: st, nd, th, rd?...
  • Previous by thread: Re: need a fix in this entourage script
  • Next by thread: Entourage X delete emails for good.
  • Index(es):
    • Date
    • Thread