Running rules in Applescript

C

Chris Ridd

Is it possible to have an Applescript in Entourage 2004 that executes some
specific disabled rules (ie Message>Apple Rule>...)?

What I'm trying to improve is how I deal with my Junk mail folder. I first
check it for false positives (mail incorrectly identified as spam), which I
move elsewhere. I then run a number of rules to move true positives (real
spam) to another folder, and false negatives (missed spam) to yet another
folder.

I'd like to automate the running of those rules, but I don't actually see
much in the way of references to rules in Entourage's dictionary. (The only
reference I could find was for mailing lists.)

Does anyone have any suggestions?

Cheers,

Chris
 
B

Barry Wainwright

Is it possible to have an Applescript in Entourage 2004 that executes some
specific disabled rules (ie Message>Apple Rule>...)?

What I'm trying to improve is how I deal with my Junk mail folder. I first
check it for false positives (mail incorrectly identified as spam), which I
move elsewhere. I then run a number of rules to move true positives (real
spam) to another folder, and false negatives (missed spam) to yet another
folder.

I'd like to automate the running of those rules, but I don't actually see
much in the way of references to rules in Entourage's dictionary. (The only
reference I could find was for mailing lists.)

Does anyone have any suggestions?

Cheers,

Chris

Rules cannot be run from a script, but anything you can do in a rule can be
done in the script. What did you have in mind?
 
C

Chris Ridd

Rules cannot be run from a script, but anything you can do in a rule can be
done in the script. What did you have in mind?

Ah, thanks for confirming this.

Basically my AS uses each message's headers to determine which folder to
move the message to. Unfortunately Entourage gives me an error when I use
the "move" command to well, move the message. (See my other message.)

I could presumably alter the script to completely download each message I'm
trying to move (by setting each message's connection action?), but that's a
waste of bandwidth.

Cheers,

Chris
 
C

Chris Ridd

I could presumably alter the script to completely download each message I'm
trying to move (by setting each message's connection action?), but that's a
waste of bandwidth.

Actually it doesn't seem to make a difference if the messages being moved
are completely downloaded or not, as Entourage still returns an error to
Applescript: "the message is online and this operation is not yet
supported".

This seems like a pretty basic thing to want to do in a script. Is Entourage
really this deficient, or (as is more likely :) is it me? In my defence
I'll note that I find AppleScript a remarkably peculiar language so I may
well be doing things the wrong way.

Cheers,

Chris
 
P

Paul Berkowitz

Actually it doesn't seem to make a difference if the messages being moved
are completely downloaded or not, as Entourage still returns an error to
Applescript: "the message is online and this operation is not yet
supported".

This seems like a pretty basic thing to want to do in a script. Is Entourage
really this deficient, or (as is more likely :) is it me? In my defence
I'll note that I find AppleScript a remarkably peculiar language so I may
well be doing things the wrong way.

It's because the AppleScript 'move' command in the Standard Suite _requires_
a result (the message so moved) - which in Entourage means it must resolve
to a message identified by ID number in the database. Unfortunately, not all
IMAP servers are reliable enough to return this result and - as I understand
it - only UIDPLUS servers could even hope to do so. I've been requesting
Entourage-only 'move on server' and 'duplicate on server' commands in the
Entourage Mail and News Suite which would not require a result. I really
hoped they would arrive this (2004) release, but they haven't. In fact, the
new IMAP implementation seems to take more time to do things like moving and
duplicating and getting sent copies top Sent Items - it looks to me as if
it's being more thorough in making a server copy (which is actually what
every 'move' requires) in the correct location, deleting the original, then
assigning the original's ID to the "moved" copy. That's what a "move" really
does, always. It may be that AppleScript isn't implemented to follow all
that on the server and wait around for the conclusion. I have never been
told why/if it's really not possible. Maybe it's just "too difficult for
this release". We can hope so...

--
Paul Berkowitz
MVP Entourage
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 Entourage you are using - **2004**, X
or 2001. It's often impossible to answer your questions otherwise.
 
C

Chris Ridd

It's because the AppleScript 'move' command in the Standard Suite _requires_
a result (the message so moved) - which in Entourage means it must resolve
to a message identified by ID number in the database. Unfortunately, not all
IMAP servers are reliable enough to return this result and - as I understand
it - only UIDPLUS servers could even hope to do so. I've been requesting

It so happens that the server I'm using advertises support for UIDPLUS, but
I suspect that Entourage is taking a lowest common denominator approach :-(
Entourage-only 'move on server' and 'duplicate on server' commands in the
Entourage Mail and News Suite which would not require a result. I really
hoped they would arrive this (2004) release, but they haven't. In fact, the
new IMAP implementation seems to take more time to do things like moving and
duplicating and getting sent copies top Sent Items - it looks to me as if
it's being more thorough in making a server copy (which is actually what
every 'move' requires) in the correct location, deleting the original, then
assigning the original's ID to the "moved" copy. That's what a "move" really
does, always. It may be that AppleScript isn't implemented to follow all
that on the server and wait around for the conclusion. I have never been
told why/if it's really not possible. Maybe it's just "too difficult for
this release". We can hope so...

I thought I'd try duplicating the messages and then deleting the old
messages, but that doesn't work either. Darn. I'll send feedback for this.

In the meantime if there's a way for my script to call menu items that might
work around these deficiencies.

Cheers,

Chris
 
P

Paul Berkowitz

It so happens that the server I'm using advertises support for UIDPLUS, but
I suspect that Entourage is taking a lowest common denominator approach :-(

That's right. Since they can't depend on all servers to be able to return a
value, it's left un-implemented.
I thought I'd try duplicating the messages and then deleting the old
messages, but that doesn't work either. Darn. I'll send feedback for this.

In 2004, you can duplicate to a local folder (which should also have been
possible in X but wasn't) but not to another IMAP folder. Same reason.
In the meantime if there's a way for my script to call menu items that might
work around these deficiencies.

Well, you could try GUI scripting and see if it works. First you have to
open System Preferences and enable "Enable access for assistive devices".
Then move some messages using the Move button --> Move to Folder, or Message
--> Move To --> Move to Folder so all the relevant folders now show up in
that Message --> Move To submenu.

Now

tell application "Microsoft Entourage" to activate
tell application "System Events"
tell process "Microsoft Entourage"
pick menu item "Test1 (Mac.com)" of menu "Menu" of menu item "Move
To" of menu "Message" of menu bar item "Message" of menu bar 1
end tell
end tell


using whatever the name of the menu item/folder actually is (instead of my
"Test1 (Mac.com)").

--
Paul Berkowitz
MVP Entourage
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 Entourage you are using - **2004**, X
or 2001. It's often impossible to answer your questions otherwise.
 

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