Three Entourage AppleScript Questions

N

Neil Carvin

1. I have a tiny AppleScript that opens my IMAP InBox when I enter a key
sequence, which is a nice time saver for me. But the list of messages isn't
always scrolled to the top. I have the messages sorted by date, and I'd
like to ensure that the window opens with the most recent messages
displayed. Is there an AppleScript command that would do this?

2. Is it possible via AppleScript to sequence through my many saved mail
folders and set each one to the same Column View settings (e.g, always show
size, never show category)?

3. Is it possible via AppleScript to set the category of a mail folder
based on the date of the most recent message saved in the folder? I would
like to make each folder with a message newer than, say, 10 days, red
(category = PRIORITY) to make it easier to find current information.

Thanks

Neil
 
P

Paul Berkowitz

1. I have a tiny AppleScript that opens my IMAP InBox when I enter a key
sequence, which is a nice time saver for me. But the list of messages isn't
always scrolled to the top. I have the messages sorted by date, and I'd
like to ensure that the window opens with the most recent messages
displayed. Is there an AppleScript command that would do this?

No, AppleScript doesn't do much in the User Interface (UI). It mostly
operates on the object model below the surface. When Panther (OS 10.3) is
released, there will be new UI scripting that can do some of this -
particularly if there is a menu or keyboard command equivalent.
2. Is it possible via AppleScript to sequence through my many saved mail
folders and set each one to the same Column View settings (e.g, always show
size, never show category)?

If you set this for each existing folder, then any subfolders you make in
the future will inherit the same columns.
3. Is it possible via AppleScript to set the category of a mail folder
based on the date of the most recent message saved in the folder? I would
like to make each folder with a message newer than, say, 10 days, red
(category = PRIORITY) to make it easier to find current information.

You could do it by script. The tricky bit would be a recursive handler that
looked for subfolders, and subfolders of subfolders, etc. Here's a simple
version that works only on top-level local ("On My Computer") folders. It's
a simple version that just sets the category to "Priority" or to None,
depending. It's a little more complicated to add or remove the Priority
category to and from some other category the folder may have.

----------------------
set timeLimit to (current date) - (10 * days)

tell application "Microsoft Entourage"
set priorityCat to category "Priority" -- will error if this doesn't
exist
set localTopFolders to every folder
repeat with i from 1 to (count localTopFolders)
set localTopFolder to item i of localTopFolders
set newMsgs to every message of localTopFolder whose time received >
timeLimit
if newMsgs ‚ {} then
set category of localTopFolder to {priorityCat}
else
set category of localTopFolder to {} -- "None"
end if
end repeat
end tell
--------------------------


By the way, a restriction to 'incoming message' would make the script much.
much slower. Fortunately the script simply ignores outgoing (sent and draft)
messages because they don't have a 'time received' property (otherwise all
folders containing draft messages would change category), and don't error
either. So it works best this way.

--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: http://www.entourage.mvps.org/toc.html

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.
 
G

Gordon Wong

I'm running a G4 Quicksilver on the latest osX system.

We're on a company iMAP system, and I'm using Entourage. Lately a new error
(-3155) comes up. It says 'Network Error'. Any ideas?


Thanks



Gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top