Paul
Fri Jan 21 13:42:54 CST 2005
On 1/21/05 9:29 AM, in article BE169804.DA86%Proy__Inbox@hotmail.com,
"Conrad" <Proy__Inbox@hotmail.com> wrote:
>> repeat with delCategory in toDelete
>> delete delCategory
>> end repeat
>>
>> set allCategories to categories
>
> After wrapping every line in a display dialog call, I can confirm that the
> crash is actually on the line that calls for all the categories. Is there a
> reason I should be able to get all the categories again from Script Editor
> but not from Entourage's Script Menu?
Is the Categories window open as you try to run his script? If so, close it
first. It won't update when it's open, and leads to errors, including
crashes.
Categories are a bit unusual in that they've been designed to show results
in alphabetical order by name, for some reason, rather than in order of
creation (by ID). Even though they have unique IDs they behave more like
objects that have only indices (like group entries). So every time you get
the full list, they have to re-sort first. I suspect that somewhere there's
a bug when they're still in memory from before the deletions.
If the crash persists even when the Categories window is closed, you've got
problems. I can't think of any workaround to refresh the categories or
memory, if this still doesn't work with Categories window closed. You could
keep a running tally (or do it all at once) to remove the toDelete items
from an original list of allCategories you get at the beginning of the
script before doing any deleting. (That you'd have to do in a repeat loop.
populating an empty list with every member of the original list that isn't
in the toDelete list. Do this before doing the deletions so you don't error
on non-existent objects.) Then you'd have the list of still existing
categories.
By the way, in Entourage 2004 you ought to be able to delete the whole
toDelete list at once, without having to run it in a repeat loop one by one.
In fact, I think even in earlier versions that should work with 'delete'. I
believe, although not with other commands.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.