Re: Select Items in Custom View with Applescript
From: Paul Berkowitz (berkowit_at_spoof_silcom.com)
Date: 11/24/04
- Next message: Paul Berkowitz: "Re: Help Entourage 2004 will not quit"
- Previous message: Richard H: "Re: Retrieve Mail from Yahoo"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 09:03:30 -0800
On 11/23/04 11:50 AM, in article
f4c0d040.0411231150.4f11030f@posting.google.com, "Ken Hilburn"
<khilburn@gmail.com> wrote:
> I have been trying to sort through a large volume of email within
> Entourage with Applescript and, as you guys know, it's very slow and
> Entourage does not support multithreading when it comes to Applescript
> (so Entourage waits for the mass processing to complete).
>
> An alternative that would work better is to have the Applescript
> automagically select the results of a custom view (representing the
> most recent of emails in multiple folders) and then complete the
> actions that I want to perform on them.
>
> I know that Entourage (I'm using 2004) does not support this, but does
> anyone know of a solution to this?
Actually, you can do it. Open the custom view, select all, then
set hugeList to the selection
and that will give you all the items. Remember that 'whose' clauses do not
work on AppleScript lists like the above - only on application references
which we're not using here. So you have to do everything by repeat loop.
***One piece of lore you may not know is that iterating through large lists,
is MUCH faster (possibly hundreds of times faster!) if you use 'my' when
doing so:
repeat with i from 1 to (count hugeList)
set theItem to item i of my hugeList
You can only use 'my' if this hugeList has global scope - that is, this part
of script is at the top-level (not in a subroutine) or you declare it as a
global or property: then it's OK in a subroutine too. Otherwise, to get the
equivalent speed, you need to use a script object in a subroutine - ask me
how if you're interested.
P.S. It would even be possible to open the custom view by script and select
all by GUI scripting - probably - if you wanted to automate the whole thing.
Ask that too if interested.
-- 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.
- Next message: Paul Berkowitz: "Re: Help Entourage 2004 will not quit"
- Previous message: Richard H: "Re: Retrieve Mail from Yahoo"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|