• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Moving (to) Mail....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving (to) Mail....


  • Subject: Re: Moving (to) Mail....
  • From: cricket <email@hidden>
  • Date: Tue, 27 Aug 2002 11:42:03 -0700

On Monday, August 26, 2002, at 01:05 PM, martin schiller wrote:

Connection script (was run on emailer schedule)

set acctlist to ["timebender", "cybcon", "timebender"] --

tell application "Claris Emailer"

repeat with acct in acctlist
connect to acct with checking
connect to acct with sending
end repeat
end tell

Mail doesn't have scheduled script running capability, so you would either have to use a script scheduler of some kind or write a script that uses an idle handler. For example, this script would check email in 2 accounts:

set acctlist to {"mac.com", "mindspring.com"}
on idle
tell application "Mail"
repeat with eachAccount in acctlist
check for new mail for account eachAccount
end repeat
end tell
return 300 -- wait 5 minutes before checking again
end idle

The second script deleted messages over two days old from a list of folders. It was named 'shutdown script' and consequently ran on > 'quit'.

set striplist to ["ascript", "air-l", "sf", "x", "x-l", "x-unix", "eudora", "powermail", "tidbits", "ipnrtalk", "mactalk"]

tell application "Claris Emailer"
set thefolderlist to the entire folder hierarchy
repeat with TheFolder in thefolderlist
if the name of TheFolder is in striplist then
set themessages to the messages of TheFolder
repeat with themessage in themessages
if the time sent of themessage is less than (current date) - 2 * days then
set storage of themessage to deleted mail folder
end if
end repeat
end if
end repeat
end tell

Again, we don't have a script scheduling facility, so you would have to be creative as far as getting it to run when you want it to run. Perhaps you could write a script that does this, then quits Mail, and put this application in the Dock and use it to quit Mail instead of using command-Q in Mail.

set striplist to {"mactalk", "tidbits"}
tell application "Mail"
repeat with eachFolder in striplist
set everyMessage to messages of mailbox named eachFolder
repeat with eachMessage in everyMessage
if date sent of eachMessage is less than (current date) - 2 * days then
set mailbox of eachMessage to mailbox "Trash"
end if
end repeat
end repeat
quit
end tell

Hope that helps -- by the way, be sure to check out the sample scripts here:

file://localhost/Library/Scripts/Mail Scripts/

- cricket

----->
Software Entomologist/Mail for Mac OS X email@hidden
---------->
There is no such thing as a broad platitude.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Moving (to) Mail....
      • From: martin schiller <email@hidden>
References: 
 >Re: Moving (to) Mail.... (From: martin schiller <email@hidden>)

  • Prev by Date: Re: Difficulty Opening a Text File in BBEdit
  • Next by Date: Re: Converting Date?
  • Previous by thread: Re: Moving (to) Mail....
  • Next by thread: Re: Moving (to) Mail....
  • Index(es):
    • Date
    • Thread