Mailsmith
Other Programs
Scripts
Mailsmith.scpt
Archive to sub-mailbox
Check Spelling
Find reply
Change font size
Submit Script to JEM
Fix common spelling errors
Setting SMTP server
URL from Safari
Address from AB
linkMunge
Export to Address Book
Saving attachments
Digest Script
File with same
POP window position
Position of new windows
iCal and Mailsmith
Edit From Line
Modified Thread Script
Reply to Selection
Temporary Text Window
Compact gain
Tracking backups
Edit subject
Googler
Auto-rewrap
MMA
SMTP server
Open, fetch, and close
URL Manager
BrainForest
Thread by Author
Thread by subject
Export Email
Get Selection
Read Addresses
Export Email
Organize Email
Account setup
Mailsmith 2 BBEdit
BBEdit 2 Mailsmith
Search II
Check One
Delete Enclosure
Open, fetch, close
Set Answered
Set Redirected
Empty Trash
List found
Print Several
Del. old. msg.
Delete Enclosures
Accounts
Address Book
Editing
Filters
General
Import/Export
Links
Mailboxes
Memory
Scripting
Speed
send/receive
Tips/Tricks


Delete old messages

Author Christian Smith
Last modified 1998-11-02
What is this?

There is no built-in command of doing this but since this is Mailsmith it's of course possible to make a AppleScript to do it. Here is how to do it, described by Christian Smith at Bare Bones Software

Here is a script I just wrote in response to a customer request. The original request was to have Mailsmith be able to auto-delete messages in the trash which had been there longer than a certain date. This is a feature in Email and a few other clients which is missing (at present) from Mailsmith. This script if run on a regular basis will provide something akin to this by using the Notes field of messages in (trash).

The script as written will attempt to get the notes field of a message in the trash as a real number and will compare it against an offset from the current date. If the difference is more than 259200 (three days in seconds) the message will be deleted.

If the script can't get the notes as a real number it sets the notes field to the current offset from a given date.

The specific date being used "Thursday, March 04, 1993 12:10:00" is irrelevent to the script itself but holds a certain importance to the author.

If you run this script on a regular basis it will ensure that the trash doesn't pile up and start to smell ;-)


tell application "Mailsmith"
  set the_date to (current date) - 
    (date "Thursday, March 04, 1993 12:10:00")
  set the_list to every message of trash
  repeat with i from 1 to count items of the_list
    set the_message to item i of the_list
    try
      set date_stamp to get notes of the_message as real 
    on error
      set date_stamp to the_date
      set notes of the_message to date_stamp
    end try
    set the_age to the_date - date_stamp
    if the_age > 3 * 24 * 60 * 60 then delete the_message
  end repeat
end tell