• 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
My delete aged msg script - broke?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

My delete aged msg script - broke?


  • Subject: My delete aged msg script - broke?
  • From: martin <email@hidden>
  • Date: Sun, 15 May 2005 13:50:27 -0700

I cobbled together the following script to delete msgs from my mail app. I was attempting to dupe one that I had used with emailer. But with the new mail app it seems to operate differently than it did with mail app prior to tiger. Much longer to complete and much more activity in 'activity viewer' window.

If someone would point me in a productive direction I'd be grateful.

Martin

<mydeleteagedmsgs.scpt - pasted from script editor>

set deleteboxes to {"clayart", "applescript", "toyota", "woodfire", "bamboo", "sf", "marxism", "lbo-talk", "mactalk", "xlist", "nettime"}
tell application "Mail"
set localMailboxes to every mailbox
if ((count of localMailboxes) is greater than 0) then
repeat with thismbox in localMailboxes
if name of thismbox is in deleteboxes then
my deleteoldmessages(thismbox)
end if
end repeat
end if


end tell




on deleteoldmessages(mboxname)


tell application "Mail" set deletedate to (current date) - 2 * days set thislistmsgs to every message of mboxname

        repeat with thismsg in thislistmsgs
            try
                if date sent of thismsg is less than deletedate then
                    delete thismsg
                end if
            on error

            end try
        end repeat
    end tell
end deleteoldmessages

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: My delete aged msg script - broke?
      • From: pete boardman <email@hidden>
  • Prev by Date: Re: Script Editor hangs on "Open Dictionary"
  • Next by Date: Re: Script Editor hangs on "Open Dictionary"
  • Previous by thread: Re: applescript and Preview
  • Next by thread: Re: My delete aged msg script - broke?
  • Index(es):
    • Date
    • Thread