Title: Re: Would this be possible in a Applescript
On 29/5/04 1:38 am, "Scott Haneda" <[EMAIL PROTECTED]> wrote:

> I was wondering the possibility of using AS to accomplish something.
> Something I have seen no email app every do, g-mail is approaching this, but
> in a different way.
>
> After I get about 10 emails from someone, generally, they deserve a folder
> and a rule, it is something I do often enough that I don't want to do it
> anymore.  Could AS keep a count of how many emails come to me, once the
> sender count reaches a certain point, a subfolder is made in a folder I can
> specify, and a rule is created that would start filing those emails for that
> person.
>
> Ideally, a alert would come up, "this is the xth email from <sender>, would
> you like to create a folder and a rule for them?" "Then, please enter in a
> folder name".
>
> Possible?  Anything like this out there?

It is possible, by running a script against every received message, checking the sender against a saved list of previous recipients, and then incrementing a saved count for these messages to calculate what has been received.

You could also then create a new folder, and move that sender's mail into it.

About the only thing that you asked for that is not possible is the automatic creation of rules - they are not scriptable (yet).

However, such a script would be painfully slow, and get slower over time, as the list of saved data gets longer.

However, the script below will ease some of your problems - it is designed to create a new subfolder of the selected folder, and move the selected messages into it - by default, the name of the subfolder is the sender of the first selected message.


-- File in SubFolder v1.0 27/11/2003
-- An applescript for Microsoft Entourage by Barry Wainwright
-- <mailto:[EMAIL PROTECTED]>
-- Creates a subfolder and moves selected messages into it


tell application "Microsoft Entourage"
    set theMessages to current messages
    try
        set theFolder to storage of item 1 of theMessages
    on error
        display dialog "Please select some messages in a listing before running this script!" buttons {"Abort"} default button 1 with icon stop
        return -99
    end try
    set aMess to item 1 of theMessages
    set defaultName to display name of sender of aMess
    set theanswer to display dialog "What do you want to call the new folder?" default answer defaultName with icon note buttons {"Abort", "Set Name"} default button 2
    if button returned of theanswer is "abort" then return -98
    set newfolder to (make new folder of theFolder)
    try
        set name of newfolder to text returned of theanswer
    on error
        set erroranswer to display dialog "Couldn't use that name. Continue to move files?" with icon caution buttons {"No", "Yes"} default button 2
        if button returned of erroranswer is "No" then return -97
    end try
    try
        move theMessages to newfolder
    on error
        display dialog "Sorry, couldn't move the files!" buttons {"OK"} default button 1 with icon stop
    end try
end tell
--
Barry Wainwright
Microsoft MVP (see http://mvp.support.microsoft.com for details)
Seen the All-New Entourage Help Pages? - Check them out:
        <http://www.entourage.mvps.org/>

Reply via email to