Re: Emailer script to file replies with replied-to messages
Re: Emailer script to file replies with replied-to messages
- Subject: Re: Emailer script to file replies with replied-to messages
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 11 Mar 2001 10:52:24 -0800
Interesting, Michelle. I see you make use of a message property in Emailer
called 'reply id'. When I wrote a script to do the same 'file reply in same
folder' thing for Outlook Express, which does not have any such property, I
had to invent a complicated contraption storing records of the message and
folder IDs in a script property list, having a schedule run another script
to check for sent messages, loading the script with the stored records, etc.
It got very unwieldy when you had a lot of folders (which I don't myself).
Allen Watson, who used my script with his 80 or 90 folders, kept running
into annoyances with it.
In Entourage, whose scripting is based on OE's but with more features
including accessing Entourage's new UI feature 'links' (to all sorts of
other application objects), Allen realized that he could take advantage of
the fact that Entourage automatically links a reply to the message it
replied to, and that you can get this link via AppleScript. In effect, it is
the same 'reply id' property you have in Emailer. When Allen announced his
much neater solution, I remember Dan Crevier, the Entourage developer who
implements AppleScript and much else - including perhaps the whole 'links'
mechanism - enthusiastically congratulating Allen on having come up with
this solution. Dan never let on that, in effect, he had in the process of
enabling links and the scripting for them, restored this 'reply id' property
which he had first implemented in Emailer, where, as of course you know, he
had also done the AppleScripting before moving to OE.
Allen may not currently be reading AS-Users, so, unusually, I've quoted your
whole message and script below in cc'ing him. I know that he too was an avid
Emailer before moving over to OE and now Entourage, but I don't know whether
he ever used 'reply id' when he was still using Emailer.
--
Paul Berkowitz
On 3/11/01 6:20 AM, "Michelle Steiner" <email@hidden> wrote:
>
Here's a complete redo of a script I wrote a number of years ago to file
>
a reply to a message in the same folder as the received message that was
>
replied to. (This was the script that got corrupted that I was unable to
>
read, BTW). I could have written it so the dialog would say whether
>
there had never been a reply or the reply had been deleted, but that's
>
more information than is really necessary, I think.
>
>
Any suggestions for improvmements of technique, algorithms, etc. are
>
welcome.
>
>
--Michelle
>
set AnyMessagesMoved to false
tell application "Claris Emailer"
tell the front window
if its class is incoming message window then
set AnyMessagesMoved to my MoveAMessage(its displayed message,
AnyMessagesMoved)
if not AnyMessagesMoved then
my InfoDialog("The displayed message does not have existing
replies.")
end if
else if its class is browser window then
set the messagelist to the selection
if the messagelist is {} then
my InfoDialog("You have to have at least one message
selected.")
else
repeat with testMessage in the messagelist
if class of the testMessage is incoming message then
set AnyMessagesMoved to my MoveAMessage(testMessage,
AnyMessagesMoved)
end if
end repeat
if not AnyMessagesMoved then
my InfoDialog("None of the selected messages have
existing replies.")
end if
end if
else
my InfoDialog("The front window has to be either an incoming
message
window or a browser window.")
return
end if
end tell
end tell
on InfoDialog(message)
display dialog message buttons {"OK"} default button 1 with icon note
end InfoDialog
to MoveAMessage(testMessage, HasReplyFlag)
tell application "Claris Emailer"
set the ReplyMessageID to the reply id of the testMessage
if (outgoing message id ReplyMessageID) exists then
move outgoing message id ReplyMessageID to the storage of the
testMessage
set HasReplyFlag to true
end if
end tell
return HasReplyFlag
end MoveAMessage
>
>
----------------------------------------------------------------------
>
| Michelle Steiner | We're not human beings having a spiritual |
>
| | experience. We're spiritual beings |
>
| email@hidden | having a human experience. |
>
----------------------------------------------------------------------