Microsoft Entourage Scripts

E

Eric

G'Day knowledgable folk,

After having recently done the switch (i.e. waving goodbye to my IBM
PC running Windows XP, Lotus Smartsuite and MS Outlook) to a Apple
iMac I have encountered a slight problem which I need assistance with.

Previously I had a tool which diverted all my Hotmail and POP mail
into a single inbox on the IBM. Unfortunately, I have tried to do this
with scripting in Entourage 2004 and failed (and I have no idea why).

The Apple Script code I generated is shown below:

tell application "Microsoft Entourage"
move (every message in folder "Inbox" of Hotmail account "Hotmail")
to folder "Inbox"
end tell

Basically, I have a Hotmail inbox setup in entourage, and I would like
to automatically move this mail to my inbox when I recieve my e-mail.
I have found rules not to work with this approach.

Any assistance in this problem would be greatly appreciated as I am
finding this problem annoying.

Yours kindly,

Eric
 
P

Paul Berkowitz

G'Day knowledgable folk,

After having recently done the switch (i.e. waving goodbye to my IBM
PC running Windows XP, Lotus Smartsuite and MS Outlook) to a Apple
iMac I have encountered a slight problem which I need assistance with.

Previously I had a tool which diverted all my Hotmail and POP mail
into a single inbox on the IBM. Unfortunately, I have tried to do this
with scripting in Entourage 2004 and failed (and I have no idea why).

The Apple Script code I generated is shown below:

tell application "Microsoft Entourage"
move (every message in folder "Inbox" of Hotmail account "Hotmail")
to folder "Inbox"
end tell

Basically, I have a Hotmail inbox setup in entourage, and I would like
to automatically move this mail to my inbox when I recieve my e-mail.
I have found rules not to work with this approach.

Any assistance in this problem would be greatly appreciated as I am
finding this problem annoying.

For some reason, you're not telling us what version of Entourage you have.
This time, it makes a difference.

'move' will not work with messages on a server (Hotmail or IMAP) since the
AppleScript command 'move' requires a result returned, namely the message so
moved, and servers are inconsistent in their ability to supply the message
with ID. Same with 'duplicate' when the duplication )copy) is to somewhere
on a server.

This should not apply to making a local copy, however, since there's no
problem with returning the result there. So it can be considered a bug that
this will not work in Entourage X. However it _does_ work in Entourage 2004.
Arguably 'move' to a local folder should also work in 2004, since a 'move'
is nothing but a copy and delete original. However, 'move' would presume the
same ID as before, and 'delete' in Entourage really means 'move to Deleted
Items folder or mark for deletion', where the original still exists until
the server purges it, so I suppose that's why 'move' still doesn't work.

But here's the solution - 2004 only:


tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
duplicate theMsg to in box folder -- works only in 2004
delete theMsg
end tell

which you could run from a Hotmail rule to deal with each Hotmail message as
it comes in

or to deal with existing messages:

tell application "Microsoft Entourage"
duplicate every message of folder "Inbox" of Hotmail account 1 to in box
folder
delete every message of folder "Inbox" of Hotmail account 1
end tell

(Actually, you could just select all the messages in the folder and Apply
the rule, or the first script, to them.)

'delete' does not expect a result (since in other AppleScript contexts
there's nothing remaining). This will 'move' the message to your local
Inbox, and the original to the Hotmail Deleted Items folder, whence it will
be purged by Hotmail maintenance in due course.


--
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.
 
Top