Mail Scripts 2.10.3
Some of the scripts installed as part of 'Mail Scripts' are not compatible with MacOS X 10.7 (Lion) or higher — Apple made some changes (e.g., partially breaking AppleScript in Mail, removing Perl 5.8) which make it impossible to update the scripts so that they would work correctly again.
For people wanting to play with the scripts, you are welcome to download the complete source from the download link below.
Thank you to everyone that supported the development over the years and I am sad to have to stop development and support but I don't see any feasibility to continue at this point in time.
Introduction
MacOS X's Mail and Address Book have large AppleScript dictionaries which allow almost every aspect of these programs to be scripted. Since some features are rather cumbersome in the standard implementation, I decided to write some scripts to ease workflow. I started writing the scripts after the release of MacOS X 10.2 (Jaguar) and made several improvements and additions over time. After the release of MacOS X 10.3 (Panther) all scripts have been completely rewritten as AppleScript Studio applications allowing for many additional features.
Mail Scripts is a collection of AppleScript Studio applications for Mail and Address Book offering additional features or simplified workflow. Mail Scripts consists of the following scripts:
Add Addresses (Mail)
- Add addresses found in the selected messages (in the header fields "From", "To", "Cc", "Bcc", and "Reply-To") to the Address Book. This is much more flexible than the "Add Sender to Address Book" available in Mail and provides a convenient way for creating mailing lists.
Archive Messages (Mail)
- Move messages from the selected mailbox(es) to an archive mailbox or export them to standard mbox, plain or rich text files for backup purposes or import into other applications. You can select to move all messages or only messages sent within or certain period as well filter messages based on their read and flagged status.
Change SMTP Server (Mail)
- Switch between different already defined SMTP servers or define a new one. This is especially useful if you are using your computer in more than one location and have to switch servers for several accounts at once.
Create Rule (Mail)
- Create a new rule based on the first of the selected messages. This saves you the trouble of copy/pasting address or other info between the message and the rule window and provides a much quicker way for setting up a rule with multiple criteria/actions.
Remove Duplicates (Mail)
- Locate all duplicate messages found in the selected mailbox(es) and move them to a separate mailbox for easy removal (on 10.4 and higher, duplicate matching is based on the message source, on 10.3 it is uses the unique message header "Message-Id" for initial matching).
Schedule Delivery (Mail)
- Allows you to send individual messages at predefined times (this script uses iCal for scheduling message delivery).
Send all Drafts (Mail)
- Immediately send all messages in the "Drafts" folders for all accounts. This saves you from having to open each draft in order to send it.
Open Mailbox, Open Message (Mail)
- Two small faceless scripts which will open mailboxes with new messages or the new messages themselves when run as a rule action.
Filter Sent Messages (Mail)
- Another faceless scripts which will apply your rules to the messages in the "Sent" mailbox.
Export Addresses (Address Book)
- Export addresses from the Address Book into tab-delimited text files. You can select which groups and which fields you want to export.
Search Addresses (Address Book)
- Find all addresses inside the Address Book matching one or more criteria. As opposed to the "Search" function built into the Address Book, this lets you search in any field as well as for empty and non-empty fields (Note: due to a bug in the Address Book's AppleScript implementation, "First Name" will always return a non-empty value for system versions of at least up to 10.3.2 - I have reported this bug to Apple and hope that they fix it with the next system update).
- As an example, you might use this script to search for all phone numbers with a certain area code in order to update your contacts after an area code change.
After running the installer, the scripts are located inside a folder called "Mail Scripts" located inside your Applications folder (even though you can move the scripts to any other location of your liking, the installer will not remove previous versions located at a different path). You can run the scripts either from double-clicking their icons from within the Finder or using the launch scripts (or assigned keyboard shortcuts) from within the script menu inside Mail and Address Book (the script menu is the menu with the paper scroll icon. In 10.3.x, it is located to the left of the Help menu - in 10.4.x and higher it is located on the far right of the menu bar).
General Remark: Mail's AppleScript implementation does not seem to be able to handle too many request if Mail is busy doing something else. Some of the scripts seem to run better if you take all your accounts offline first (Choose "Mailbox→Online Status→Go Offline" from Mail's menu).
Add Addresses
- Select all messages you want to use for creating the mailing list (for creating a mailing list, you would choose all messages in a mailbox which contains all messages on a certain topic).
- Run the script and you get a list with all addresses contained in the selected messages - mark all the addresses you want to add to the Address Book using the checkboxes.
- From the popup menu, choose which group you want to update with the selected addresses or select "Create new Group..." and enter the name for the new group to be created.
- The script checks whether an address is already present before adding it to the Address Book in order to avoid duplicate entries. If additional information is available for an entry already present in the Address Book (e.g., full name information for an entry which had prior been email-only), the entry will be updated.
Archive Messages
- After starting the script, you will be presented with a list of your mailboxes - choose the ones you want to archive messages from using the checkboxes (note: mailboxes which don't contain any messages will not be displayed in the list).
- You now have the option to either perform an "Archive" or an "Export" of messages in the selected mailboxes. "Archive" moves the messages into a newly created Archive mailbox with the current date, "Export" leaves the messages in the mailboxes and generates text files in a location you can select.
- After selecting either of the buttons, you will be presented with a dialog which will allow you to specify options for your archive/export operation (filter messages based on dates, read and flagged status, output file format and location for export). Your selection (other than the dates which default to today for "before" and one year ago from today for "after") will be remembered when you run the script again.
- Note on export file formats: if you want to import your mail messages into another mail client, choose "mbox", a standard mailbox format which can be read by most programs. If you only care about the message text and want to minimize the overhead for your archive, select "text" and your files will be much smaller and easier to read. For a nicer looking text version, choose "rich text" files - this also gives you the option to include attachments.
- When selecting "One File per Message" for exporting messages to text files, the naming of the resulting files can be defined by the user. Certain placeholders can be used to access message-specific information:
- %f: "From" header (the sender of the message)
- %t: "To" header (the recipient of the message)
- %p: Sender or Recipient (sender for received messages, recipient for sent messages)
- %s: "Subject" header (the subject of the message)
- %d, %m, %M, %y, %Y: day, month (numerical or as text), and year (2- and 4-digit, respectively) of the message date
In order to keep the previous file naming convention, use the default "%f, %M %d, %Y - %s". To have messages sort by date and then by person, use something like "%Y-%m-%d, %p - %s". You will see the file name for the first message in your selected mailboxes resulting from the selected settings just below the file name field.
Change SMTP Server
- When running the script, you will be presented with a dialog showing all your accounts with the currently selected SMTP server for each of them.
- Clicking an account's SMTP server displays a drop-down menu showing all SMTP servers that have been added to Mail. Choose the desired SMTP server for each individual account (accounts for which the SMTP server has been changed will display a checkmark in the checkbox to the left of the account's name).
- After making your selections, click the "Change" button to change the settings for all accounts at once.
Create Rule
- Select the message you want to base your new rule on (only the first message will be considered) and run the script.
- In the script's main window, you can rename the rule, select the criteria you want to base your rule on, and choose one or more action to be performed for new incoming messages matching the criteria. Note - per default, there will be one criteria for the subject and each address in all the mail's headers - you can change the values for each of these headers in the list.
- The new rule will be created at the end of your existing rules.
Remove Duplicates
- After starting the script, you will be presented with a list of your mailboxes - using the checkboxes, choose the ones you want to scan for duplicate messages. Note: messages will be compared to other messages on a per-mailbox basis.
- On system 10.3.x, the script will find messages with identical "Message-ID" headers in a first pass, then compare the full message source for messages with identical Message-ID headers to identify duplicates. This approach requires a non-empty Message-ID header for finding duplicates - a requirement no longer present when running Mail Scripts 2.9 or higher on system 10.4 or higher.
- Run the script and all duplicate messages will be moved to a new mailbox called "Duplicate Messages" - upon completion of the script you will get a dialog telling you the number of messages the script found. Note: depending on the number of messages you are scanning, this operation might take a long time.
- After checking the duplicate messages you can now delete the "Duplicate Messages" folder to get rid of the duplicates.
Schedule Delivery
- The script will present you with a list of all messages in your Drafts mailbox, allowing to set, change, and remove schedules for individual messages.
- The script uses iCal for scheduling the message deliveries (iCal 1.5.2 or higher is recommended) - it will create a new calendar called "Mail Scripts" for message sending events. Please make sure that your computer is running at the time you scheduled for message delivery - if the computer was shut down or asleep, messages will be sent as soon as the computer is running again.
- Note: the scripts uses Message-IDs to keep track of which message it should send. Since Mail changes the Message-ID when you change a draft saved previously, you will have to re-schedule message delivery after changing a scheduled message.
Send all Drafts
- Running this script will immediately send all messages found in any of the "Drafts" folders - if you have an active internet connection (otherwise they will stay in the Outbox and will be sent as soon as your connection is active again).
- If you run the script and there are no messages in your "Drafts" folders, the script will quit immediately without giving you any feedback.
Open Mailbox, Open Message
- Both these scripts are faceless applications which should be run as a rule action and will then act on the message(s) triggering the rule, either opening the mailbox with the new message(s) or the new message(s) themselves in a new window. Just choose either of these scripts (located in ~/Library/Scripts/Mail Scripts/) for the "Run AppleScript" rule action.
Filter Sent Messages
Mail does not apply rules to sent messages - if you want to organize your sent messages in mailboxes together with your received messages, you have to manually select all messages in your "Sent" mailbox and choose "Apply Rules to Selection" from the menu. This script tries to automate this for you.
Note: this script is somewhat ugly and slower than Mail's internal apply rules command - things would be so much easier if Mail would allow rules to be applied to sent messages or at least supply an AppleScript command "apply rules to selection". Please let Apple know that they should add this in future versions of Mail.
- When the script is run, it applies your rules to all messages which have been sent after the last time the script was run (this means that the script should be faster since it won't check messages not matching any rule every time - if you added a new rule (i.e., the total number of rules defined in Mail changes) all messages will be checked again).
- The script only performs "Move Message to Mailbox ...", "Mark Message as Read", and "Mark Message as Flagged" actions (honoring "Stop Evaluating Rules") - "Copy Message to Mailbox" actions would result in potentially many duplicate messages and most other actions don't really make sense for sent messages.
- The script makes the following assumptions:
- Since you are the sender of all your sent messages, rules "Sender is in my Address Book" and "Sender is in my Previous Recipients" will always be true (and their respective opposites false).
- "Sender is (not) Member of Group" conditions will be ignored - Address Book lookups would make the script too unresponsive since it would have to launch the Address Book application.
- "Message is (not) addressed to my full name" conditions will be ignored - since you sent the messages, it is fairly unlikely that they are addressed to you as well.
- In order to automatically filter all your sent messages, create a new rule at the beginning of your rules, set to match "Every Message" and run the script as its only rule action. This will trigger the script every time your receive a message - this is as "real-time" as currently possible.
Export Addresses
- Select the groups you want to export using the checkboxes. If you select to export groups, the script will create a file called "<Group>.txt" for each of the selected groups on your Desktop, otherwise all addresses will be written to a file called "Contacts.txt" on your Desktop. Note: files with the same name on your Desktop will be overwritten!
- When choosing "Export", you will be presented with a dialog sheet which allows you to select the fields you want to include in the export. These selections will be stored for the next time you run the script.
- Other options include file format (tab-delimited, comma-separated, and custom delimited text files) as well as output character encoding (Unicode (UTF-16) or MacRoman). If you have problems importing the resulting files into other applications, de-select the Unicode checkbox - some programs don't handle UTF-16 data correctly (unless your contacts contain characters not present in the MacRoman character set, you will not lose information doing so).
- In the script's main window, you can define one or more criteria for your search. The fields "Name", "Address", "Email", and "Phone" will search in any of the fields listed below these header field, searching in unspecified address fields (e.g., "Street") will search the corresponding field for all addresses, regardless of the address type.
- You can enter multiple criteria for a search in the following way: "[a,b]" will search for entries with either "a" or "b" (be sure not to include additional spaces inside the brackets and make sure that the brackets are the first and last character of your search string). If you need to include a comma in your search string within "[...]", use "\,".
- If you entered more than one criteria, you can either match any or all of them ("OR" vs. "AND" search).
- While the script performs the search, the list of criteria will be updated with the number of contacts matched for each criteria.
- Once the search is complete, the script will show you a list of the contacts which matched your search and gives you the option to add them to a group in the Address Book.
- Some of the scripts will not work properly when FileVault is enabled. This is due to some major bugs in AppleScript when FileVault is used. The problems mainly occur when files are being written - try selecting a location outside your encrypted home folder for the generated files.
- Due to an error in Mail, some mailboxes cannot be accessed via AppleScript. An example are mailboxes whose name ends with ".mbox". Since there is nothing I can do about that until Apple fixes this problem (I have reported this as bug 3981637 to Apple), these mailboxes will simply be ignored in all the scripts. If a mailbox selection list is missing some of your mailboxes, you will have to rename the mailboxes in order for the script to access them.
- Some scripts might give random errors at times (NSReceiverEvaluationScriptError: 4 being a more common one). This is due to the fact that some of the scripts (mainly "Remove Duplicates" and "Archive Messages") are hammering Mail with AppleEvents. When Mail is busy doing something else while listening/replying to those events, an error might occur. If you encounter this issue, the following might help:
- If the error occurs when starting the script, simply try to start it again
- take all accounts offline from within Mail before running the script
- force Mail to rebuild all its index files: in the Mailbox drawer, make sure that your mailbox hierarchy is fully expanded (all triangles pointing down), then click on the very first mailbox in the list, shift-click on the very last mailbox (this will select all mailboxes). In the message list preview, you will now see a list of all your messages in all your mailboxes. Wait until Mail stops displaying the spinning wheel in the top right corner of its window and the number of messages displayed stops increasing
- Fonts and colors are not preserved when exporting messages to RTF files. This is due to the RTF format which makes storing that information for many messages difficult since all colors and fonts used in all messages would have to be known at the beginning.
- The Schedule Delivery script will not be able to send scheduled messages if the script was running at the time a message was scheduled to be sent - make sure you close the script when you are done scheduling your messages to be sent. Also, please be aware that the script uses 24-hour time for scheduling and make sure that the option "Turn off alarms when iCal is not running" in the "Advanced" pane of iCal's preferences is turned off (default setting).
- (Additional known issues are listed in the next two system-specific sections)
- Apple removed the application script menus in Mail and Address Book - the scripts are still accessible from the system-wide script menu (use /Applications/Apple Script/AppleScript Utility to enable to script menu) but the keyboard shortcuts don't work any more (Even though you can assign keyboard shortcuts to the system-wide scripts menu using the System Preferences and have them show up properly, they simply don't do anything - Apple bug ID 4126790).
- Using the "Archive Messages" script to export messages with attachments located on an IMAP server will sometimes cause the attachments to be lost. This is a bug in Mail's AppleScript implementation and has been reported to Apple as bug ID 4450795.
- When the "Open Message" and "Open Mailbox" scripts are run as a rule action, they sometimes might crash Mail - this seems to be due to a change in the threading behavior in Mail 2.0 and for now it might be safest not to run these scripts as part of a rule in Tiger. You can probably set up a few "smart mailboxes" which are at least as useful as these scripts used to be.
- Messages sent using the "Send all Drafts" or "Schedule Delivery" scripts sometimes display the wrong date/time in the message list. However, the "Date:" header of the actual message is correct (the message will show the correct date/time in the preview pane) and the date/time in the message list can be fixed by rebuilding the mailbox the message is contained in.
- (Tiger compatibility notes above still hold)
- When sending messages other than text/plain (i.e., messages with formatting or attachments) from a POP account using either the "Send all Drafts" or "Schedule Delivery" scripts, the message will not appear in the "Sent" mailbox after sending (Mail does not allow composing messages other than plain text via AppleScript so the scripts have to use several work-arounds to make this work). To work around this, the script will automatically add an additional "Bcc:" header with the sender address if the address is not already present in any of the message recipients (this means that you will get a copy of the message in your InBox instead).
If you are missing copies for some of your outgoing messages (either in the Sent mailbox or through Bcc), issue the following commands in the Terminal application to automatically add your own address as a Bcc recipient for all messages:
defaults write com.aamann.MailScripts.ScheduleDelivery alwaysUseBCC -bool 'YES'
defaults write com.aamann.MailScripts.SendAllDrafts alwaysUseBCC -bool 'YES'
- Mail does some rather aggressive message caching - this can lead to the appearance that the "Remove Duplicates" script does not work correctly (e.g., running the script twice on the same mailbox will still find duplicates the second time around). In order to avoid this, you can run Mail's "Rebuild Mailbox" command before and after running the script.
- (Leopard compatibility notes above still hold)
- There currently seems to be no way to have the Installer automatically add the system-wide script menu - if you don't already have the menu in your menu bar, you can enable it in the preferences for the "AppleScript Editor" application located in your "Utilities" folder.
- Sending draft messages and scheduling messages does not currently seem to work for messages sent through an Exchange server - I don't have access to an Exchange server so I currently cannot investigate this to try and fix this.
- Some of the scripts no longer work — due to changes in the system Apple did with 10.7, the scripts that no longer work unfortunately cannot be updated to work and development for the scripts has been officially been stopped at this time.
Disclaimer
I wrote these scripts for my own personal use and they work for me. Mail Scripts are provided "as-is" and I don't take any responsibility for the integrity of your mail and address data - please make sure that you have an adequate backup of your data before using the scripts.
Mail Scripts are distributed free of charge - I decided to make them available for the Macintosh community. I have a day job and I will still survive if nobody sends me money - I am happy with hearing that I saved someone's day with my little scripts. However, donations are not turned away;-) - you can make a secure donation through PayPal.
Mail Scripts may not be redistributed via the web or any other electronic media except with explicit written consent by the author.
System Requirements
Since Apple doesn't keep the AppleScript dictionaries for Mail and the Address Book consistent between major system versions, the latest compatible version of the scripts depends on the system version you are running:
- Current Version (2.10.1 and higher): MacOS X 10.4.x through MacOS X 10.6.x
- Version 2.10: MacOS X 10.3.x (development frozen)
- Version 1.3.7: MacOS X 10.2.x (no longer actively supported, development frozen)
The scripts are universal binaries (PPC & Intel) and should run properly on every computer which is able to run MacOS X.
Download Link
Download the latest version of the scripts Version 2.10.3, 3.3MB — requires MacOS X 10.4 or higher — please note that MacOSX 10.7 or higher are not supported and some of the script will not work.
Previous versions of the scripts are no actively supported but are still available for users running older system versions:
Version 2.10 for MacOS X 10.3.x (disk image, 4.2MB)
Version 1.3.7 for MacOS X 10.2.x (StuffIt archive, 218kB)
If you want to look at the source code of the various scripts, you can download a project (Xcode 3.1 or higher) with the complete source (1.7MB) — don't blame me if you don't understand everything or screw up your system by changing some of the code;-) If you decide that my code is useful and use some of it in your own projects, please add proper credit and mention my scripts.
Mail Scripts are currently fully localized in the following languages: English (development language), German, Dutch (translation by Guy De Lee), French (translation by Sébastien Marty), Italian (translation by Marcello Teodori), Greek (translation by the Hellenic Macintosh User Group), Brazilian Portuguese (translation by Gui Leite), and Norwegian (translation by Egil Helland). Please contact me if you want to help localizing to other languages.
Acknowledgements
Thanks to Yoram Blumenberg for making a much cleaner and nicer-looking icon for Mail Scripts than what I originally came up with.
For providing code for making the "Remove Duplicates" script perform much faster and no longer rely on the presence of Message-ID headers on system 10.4 and above, many thanks go to Charlie Ford and Ben Trask.
2.10.3 (July 10, 2011)
Improvements/bugfixes:
- (Schedule Delivery): fix issue where the script would launch into its UI rather than sending the message at the scheduled time.
- (Archive Messages): update the included Perl modules and re-compile them as universal binaries in order for the script to run when Rosetta is not available (e.g., MacOS X 10.7 "Lion").
- Update all website references to go to the new website URL.
Show full version history
Hide older version history
2.10.2 (May 12, 2010)
Improvements/bugfixes:
- (Schedule Delivery, Send all Drafts): fix issue with "The message cannot be sent using the server (null)" appearing when trying to send a message from a IMAP account.
- (Remove Duplicates): adapt the script to work correctly for mailboxes located on an Exchange account.
2.10.1 (December 6, 2009)
Improvements/bugfixes:
- (Schedule Delivery): work around changes introduced in the various AppleScript dictionaries made by Apple between 10.5 and 10.6. This should fix the iCal got an error: Can’t get «class wr10» of event id "F7F4AE27-7721-4499-BE10-25423AC15D5E" of calendar id "191F4FE4-B5A4-49FC-889A-D8960638FFBF". (-1728) issue when running on 10.5.x.
2.10 (October 4, 2009)
New features:
- Updated scripts for Snow Leopard (MacOS X 10.6) compatibility - please make sure to read the Snow Leopard compatibility section.
- (Filter Sent Messages): in addition to "Move Message ..." rule actions the script now also handles "Mark Message as Read" and "Mark Message as Flaged" actions.
Improvements/bugfixes:
- (Archive Messages): fix visiblity of some fields in the options dialog when bringing the dialog up again after cancelling it the first time.
2.9.1 (June 28, 2009)
Improvements/bugfixes:
- (Archive Messages): make sure to limit file name length to 255 bytes, not 255 (Unicode) characters to prevent error messages when exporting messages with long subjects containing non-ASCCI characters.
- (Archive Messages): prevent AppleScript error when choosing a new archive location if the previously selected folder was deleted while the script was running.
- (Export Addresses): make sure that the Unicode BOM is written correctly regardless of the CPU type in order to prevent writing seemingly garbage when exporting UTF-16 files.
- (Filter Sent Messages): correct processing of rules with multiple criteria if the first criteria was true and the second one contained an "Any Recipient" rule - "Any Recipient" was previously always matched in this case.
- (Schedule Delivery, Send All Drafts): work around the "The message cannot be sent using the server (null)" issue for messages with formatting or attachments when running under MacOS X 10.5
Note: messages other than plain text sent from a POP account with either of these scripts will not show up in the "Sent" mailbox after delivery - instead, you will get a copy of the message delivered to your Inbox (via Bcc).
- Significantly decrease the download size of the scripts.
2.9 (January 25, 2009)
Improvements/bugfixes:
- (Remove Duplicates): completely rewrite the script to work around a bug in the Apple-supplied "grep" command line utility. On system 10.4 and higher the script no longer requires the presence of Message-ID headers for message matching and parsing/matching is several times faster than in previous versions. Many thanks to Charlie Ford and Ben Trask for providing new command-line utilities optimized for this task.
- (Archive Messages): fix exporting of root-level mailboxes when preserving the mailbox hierarchy.
- (Archive Messages): fix writing of message separator when writing multiple messages as plain text into a single file.
- (Archive Messages): don't write "\fs20" tags around [Image] place holders when exporting messages as plain text.
- Work around potential race conditions when starting some scripts to avoid "The variable 'theName' is not defined" error messages.
- No longer automatically quit scripts upon completion to allow multiple runs of the same script without having to restart every time (user request).
2.8.3 (December 23, 2007)
Improvements/bugfixes:
- (Export Addresses): Fix error Can't convert "Full Name" to text. (-1700) when trying to export addresses in pre-Leopard system as non-Unicode text.
2.8.2 (November 19, 2007)
Improvements/bugfixes:
- (Export Addresses): Fix error "Address Book got an error: Can't get address 1 of person id "C45E46A9-3C82-499C-82FB-F8C11ADDA29E:ABPerson" whose label = "work". Invalid index. (-1719)" when trying to export addresses in Leopard and one of the contacts did not have a work address.
2.8.1 (November 19, 2007)
Improvements/bugfixes:
- (Schedule Delivery): Make the script work again on pre-10.5 systems - iCal's AppleScript dictionary for an event's "uid" changed between 10.4 and 10.5 - simply compiling the script in 10.5 made it fail in earlier system versions. The script now compiles correctly under Leopard for all system versions but might no longer compile under earlier system versions without changes.
- (Schedule Delivery, Send all Drafts): try to work around a problem where Mail fails to return the account of a draft messages (which would have manifested itself in the error message "The variable theAccount is not defined" and a failure to actually send the messages before).
2.8 (November 11, 2007)
New features:
Improvements/bugfixes:
- (Search Addresses): remove automatic adding of search terms to the list when pressing "Enter" (which was added in version 2.7.14) - it had a few unintended side-effects that made searching a little unpredictable.
2.7.16 (October 20, 2007)
Improvements/bugfixes:
- (Send all Drafts): fix bug introduced in 2.7.15 wich would result in an AppleScript error (Mail got an error: can't make |account| of |mailbox| of message id … of mailbox "Drafts" of account "…" into type reference. (-1700)) when trying to send non-text/plain messages in 10.4.x.
2.7.15 (October 14, 2007)
Improvements/bugfixes:
- (Archive Messages): properly preserve the mailbox hierarchy when exporting nested mailbox hierarchies to disk - apparently this was broken since 2.7.12.
- (Schedule Delivery, Send all Drafts): small improvement in speed and robustness when sending messages in HTML or containing attachments (10.4.x).
2.7.14 (September 29, 2007)
Improvements/bugfixes:
- (Archive Messages, Remove Duplicates): highlight the mailbox currently processed and scroll the table view so that it is visible in order to provide better feedback about the current status of the script.
- (Archive Messages, Remove Duplicates): make the mailbox column auto-resize when resizing the window so that we don't cut off the end of long mailbox names.
- (Archive Messages): make sure that exporting to one RTF file per message works correctly in MacOS X 10.3.x (problem caused by change in AppleScript's "do shell script" behavior).
- (Schedule Delivery, Send all Drafts): improve message sending of richt-text messages and messages with attachments - the "Date:" header will now show the correct date/time the message was sent (not the time the draft was last saved).
Note: The date/time in the message list in Mail might still be shown incorrectly - a mailbox rebuild will correct this.
- (Schedule Delivery, Send all Drafts): find a more elegant way to convince Mail to send messages from the Outbox - the scripts will no longer quit and restart Mail to achieve this.
- (Schedule Delivery): remove the 'Mail Scripts' calendar from iCal after sending the last scheduled message.
- (Schedule Delivery, Search Addresses): improve keyboard navigation/focus - hitting "Enter" in a text field will now trigger the expected action.
2.7.13 (April 22, 2007)
Improvements/bugfixes:
- (Archive Messages): when running on an Intel processor, explicitly invoke Rosetta when running perl - it seems like Apple changed the way Rosetta is used in bundled applications.
This should get rid of the error message "Archive Messages (Mail Scripts): Can't load 'Perl/auto/MIME/Base64/Base64.bundle' for module MIME::Base64: dlopen(Perl/auto/MIME/Base64/Base64.bundle, 1): no suitable image found. Did find: Perl/auto/MIME/Base64/Base64.bundle: mach-o, but wrong architecture at /System/Library/Perl/5.8.6/darwin-thread-multi-2level/DynaLoader.pm line 230." in the console.log and incorrectly formatted messages when exporting to rich or plain text.
2.7.12 (April 21, 2007)
Improvements/bugfixes:
- (Add Addresses): don't show smart groups in the popup as new contacts obviously cannot be added manually to a smart group.
- (Add Addresses): try to work around a bug in Mail (Apple bug ID 5147376) where it fails to parse addresses in the form "<user@host>" (they would have displayed as "<user@host> <user@host> <user@host>" before, leading to some ugly entries in the Address Book).
- (Add Addresses): remember the last selection for the address label and preselect it when starting the script the next time.
- (Archive Messages): when exporting to rich text files, create *.rtfd packages only when needed (i.e., when attachments are present) - the script now defaults to simple *.rtf files. This will make opening the files with applications not familiar with the *.rtfd format (e.g., Microsoft Word) easier.
- (Archive Messages): also add a file extension when exporting to one file per message to make the resulting files' format a little more obvious.
- (Archive Messages): use a shell script instead of calling the Finder when creating folders for exported messages - this hopefully will avoid the timing issues leading to random type -1409 errors.
- (Filter Sent Messages): Fix the script to correctly work for rules based on custom messages headers.
- (Remove Duplicates): don't ignore Message-IDs shorter than 12 characters when looking for potential duplicates.
- (Remove Duplicates): a few fixes for character escaping in the shell scripts for initial scanning for duplicate Message-IDs.
- (Remove Duplicates): be a little smarter about which message to move to the duplicates folder based on message status - the message status is now ranked based on message flags in the following order: flagged, replied, redirected, forwarded, read.
2.7.11 (August 21, 2006)
Improvements/bugfixes:
- (Add Addresses): also scan the "Reply-To" header and add addresses to the list which can be added to the Address Book.
- (Archive Messages): try to work around a race condition in the file creation of AppleScript in order to avoid errors of type -1409 when exporting to one RTF file per message.
- (Remove Duplicates): when running on 10.4.x, improve the speed of the initial scanning for Message-IDs by adding "-m 1" to the grep used in the bundled shell script.
- (Remove Duplicates): properly identify duplicates with Message-ID headers spanning two lines or containing "*" characters.
- (Export Addresses): use ";" instead of "," as the line separator in addresses with multiple lines when exporting to a comma-separated file.
2.7.10 (January 22, 2006)
Improvements/bugfixes:
- (Archive Messages): fix bug which would result in missing messages in the produced RTF files if any of the exported messages contained "/", "{", or "}" - the messages were actually present in the exported files but not visible with a RTF capable editor.
- (Archive Messages): fix bug which would result in incomplete messages when exporting HTML messages to RTF and the HTML messages contained anchor elements.
- (Archive Messages): try to be a little more forgiving about malformed HTML messages (e.g., missing closing tags) in order not to produce corrupt RTF files which would refuse to open.
2.7.9 (January 15, 2006)
Note: This update is only required for Macs with an Intel processor - it does not contain any code changes to the scripts.
- Build the "Archive Messages" script as PPC-only version (all other scripts are universal binaries) - it will run just fine under Rosetta on Intel-based machines (I have tested this). This change was necessary since it seems to be impossible to compile the bundled Perl packages for the i386 architecture on a PPC machine. Exporting messages as RTF files did not work for the previous versions on Intel-based machines since applications cannot run in a mixed native/emulated environment.
2.7.8 (November 17, 2005)
Improvements/bugfixes:
- (Schedule Delivery, Send all Drafts): on 10.4.x, revert to the old method of sending messages for plain text messages (it still does not work for messages with formatting and/or attachments). This has the advantage that the "Date:" header of the messages will reflect the actual time the message was sent, that the message will include less unneeded formatting and headers, and that Mail does not need to be restarted in order for the messages to be sent. Note that this still does not work for messages with formatting and/or attachments due to changes made in Mail's implementation.
2.7.7 (November 2, 2005)
New features:
- Norwegian localization courtesy of Egil Helland.
Improvements/bugfixes:
- (Archive Messages): Use the default file naming convention (%f, %M %d, %Y - %s) if nothing is entered in the options panel and individual file names have been chosen. This should avoid the error "Can't convert characters 1 thru -6 of ".rtfd" to Unicode text. (-1700)" in this rare scenario.
- The Installer now asks for an administrator password if permissions in the user's script folder need repair (most likely caused by some other installer messing up the permissions in the first place).
2.7.6 (October 8, 2005)
Improvements/bugfixes:
- Fix typo in the work-around for mailbox selection which resulted in an error when running in 10.3.x (Cant get text item 2 of "NSCannotCreateScriptCommandError". (-1728))
2.7.5 (September 30, 2005)
New features:
- Brazilian Portuguese localization courtesy of Gui Leite.
Improvements/bugfixes:
- Use a workaround to get the selected message's mailbox in Tiger since Apple has still not fixed this bug (credit goes to John Maisey who posted a nice way on the Apple Discussion Forum). This re-enables the automatic mailbox selection for "Archive Messages", "Create Rule", and "Remove Duplicates".
- Make sure that the English versions of the launch scripts are properly removed from the scripts menu when installing on a non-English system running 10.4.x.
2.7.4 (August 25, 2005)
Improvements/bugfixes:
- (Change SMTP Server): Fix error message "The variable UpdateAvailable is not defined. (-2753)" when checking for updates.
- (Remove Duplicates): Work around a memory limitation and poor memory management in the AppleScript framework. The script now will no longer compare the full message sources for messages larger than about 260kB (mostly messages with attachments) - these messages will be identified as duplicates when their Message-IDs as well as their message sizes match.
This should prevent errors of the type "An AppleScript error -xxxxx has occurred. (-xxxxx)" (which xxxxx being a random 5-digit, non-documented error code).
2.7.3 (August 13, 2005)
Improvements/bugfixes:
- (Remove Duplicates): Fixed bug which would result in the error "The variable theEMLXMatch is not defined. (-2735)".
- (Remove Duplicates): Make sure to find duplicate messages with "[", "]", or single quotes in the Message-ID.
- (Schedule Delivery): Minor changes in order to try and make the script a little more robust.
- (Export Addresses): Speed up en-/disabling of check boxes in the field selection dialog.
2.7.2 (June 12, 2005)
Improvements/bugfixes:
- (Remove Duplicates): Don't list the duplicates mailbox with the other mailboxes since searching for duplicates in it doesn't really make sense...
- (Remove Duplicates): Fix the script so that it will search in account-related mailboxes of POP-accounts as well (InBox, Sent Messages, Drafts, ...) - this was broken on Tiger.
- (Remove Duplicates): Optimize the script to make it more efficient - especially on Tiger the speed increase should be obvious when searching large mailboxes with only a few duplicate messages (the script now extracts Mail's id of the message from the filename on disk instead of having Mail search for all messages with a certain Message-ID).
- Attach the dialogs with the results from update checks to the main script windows for a cleaner UI.
- Updated the project to the new version of Xcode (2.1) and adjusted some settings as needed. The scripts are now built as "Universal Binaries" and should work fine on Macs with Intel CPUs.
2.7.1 (May 28, 2005)
New features:
- The installer now tries to enable the system-wide scripts menu in Tiger so that you won't have to manually do this using the "AppleScript Utility" program.
Improvements/bugfixes:
- (Archive Messages): Fix options panel - since Apple decided it would be fun to change the way window coordinates are handled with 10.4/Tiger, some options did not appear correctly.
- (Archive Messages): Fix attachment recovery for attachments with names like File-1.pdf.
- (Archive Messages): Make sure to link to the correct file when a message contains more than one attachment with identical names.
- (Archive Messages): Make the script a little more forgiving when exporting to RTF files with attachments so that we don't lose the complete message simply because something went wrong.
- (Archive Messages): Make sure to always clean up the temporary files the script created, even in case something went wrong.
- (Schedule Delivery): Fixed bug which would result in the AppleScript error "The variable theRecipient is not defined. (-2753)" when trying to schedule messages in Tiger and on of the recipients had an email-only address.
- (Schedule Delivery): Disable the "Done" button while the script interacts with iCal in order not to leave things in an undefined state.
- (Schedule Delivery): Fix "Cannot get item 1 of {}" error message which could show up on startup in some rare circumstances.
- (Schedule Delivery, Send all Drafts): Tiger seems to have broken the (undocumented) way of creating a new outgoing message from a draft which preserved formatting and attachments. When running on Tiger, the scripts now use a new approach to send drafts which preserves all formatting and attachments. In order to convince Mail to actually send of those messages, Mail will be quit and restarted by the scripts (you should probably make sure that you have all your drafts saved before running the scripts in order not to potentially lose your latest changes to your current drafts).
- Re-work the code which remembers window position and size for all the applications - the old version seemed to have led to windows not appearing after the first launch for some users. The new version now uses the "official" way instead of custom code.
2.7 (May 18, 2005)
Improvements/bugfixes:
- Updated for Mac OS X 10.4 "Tiger" (the scripts still work in Mac OS X 10.3). Note: there are some significant changes in Tiger's Mail, some of the scripts now work a little different. Please read the section about Tiger compatibility.
Work around some implementation changes and new bugs in Mail's AppleScript dictionary:
- Remove the keyboard shortcuts from the script menu scripts when installing on Tiger - they don't work any more.
- Make sure that the "Open Mailbox" and "Open Message" scripts still work when started from the scripts menu (instead of as a rule action) - the system-wide script menu does not provide the same handlers the old Mail script menu used to.
- Rule handling of Mail seems to have changed, causing the application to lock up at times when running an AppleScript rule action - make the "Open Mailbox" and "Open Message" scripts more robust in order to avoid mail locking up. It looks like there are some serious bugs in Mail's threading behaviour - it might be safer not to run these scripts as part of a rule action in Tiger. With the advent of smart mailboxes, the need for these scripts should be much smaller anyway.
- The "mailbox" property of the "message" object is currently broken in Tiger - this means that mailbox pre-selection in the "Archive Messages", "Create Rule", and "Remove Duplicates" scripts does not currently work. The scripts work fine otherwise and the feature will start working as soon as Apple fixes this bug.
- The implementation of the "extract name from" method has changed - make sure that the scripts work with both, the old and the new implementations.
- Adapt the "Remove Duplicates" script to reflect the new mailbox layout on disk - the old version did not find any duplicates on Tiger.
- Fix problem where the installer would create an empty "Mail Scripts" folder in the global applications folder and install the scripts into the user's applications folder despite sufficient privileges. This only happened for the very first installation of Mail Scripts.
- (Export Addresses): Fix problem with exporting groups whose name contains a ":".
- Updated project to Xcode 2.0
2.6.5 (April 16, 2005)
New features:
- (Export Addresses): The export format is now user selectable - choices are tab-delimited, comma-separated, or custom-delimited text files.
- (Export Addresses): The script can now output either Unicode (UTF-16) or MacRoman encoded files. If you don't have Unicode characters in your contacts, you can disable Unicode generation in order to simplify import into non fully Unicode-aware programs.
- All scripts now remember custom window sizes and positions.
Improvements/bugfixes:
- (Archive Messages): Turn automatic checking for Mail back on after clicking "Cancel" in the options sheet.
- (Archive Messages): Fix problem with incorrect RTF output for text-enriched messages with more than one "<" on a single line.
2.6.4 (April 5, 2005)
New features:
- (Archive Messages): The file naming convention when exporting messages using the "One File per Message" option is now user-definable (see "Usage" for more information and examples).
- (Archive Messages): When exporting messages to RTF files, links and email addresses inside the message body are now parsed and rendered active inside the RTF document.
Improvements/bugfixes:
- (Archive Messages): Fix bug when exporting to RTF files with attachments which would result in bad output when either the resulting filename or the attachment name contain single quotes.
- (Archive Messages): Fix exporting of messages whose header define "charset=MACINTOSH" - which really should have been "charset=MacRoman" in the first place.
- (Archive Messages): Fixed bug where some rich text formatting might still show up in exported message when exporting to RTF files (this could happen if a formatting tag was immediately following a "<" character).
- (Archive Messages): Correct header formatting when exporting to RTF files using the "All Headers" option.
- (Export Addresses): The script now produces Unicode files in order to make sure that all contacts are exported correctly. (note: some programs - like MS Excel - ignore the Unicode byte-header information in the generated file and thus fail to import the contacts correctly. This is a bug in Excel, not in the script and should be reported to Microsoft.)
2.6.3 (March 23, 2005)
New features:
- Greek localization courtesy of the Hellenic Macintosh User Group.
- Added (manual) version update check - to check whether you are running the latest version, select the menu item from the application menu in any of the scripts.
Improvements/bugfixes:
- (Open Mailbox, Open Message): make sure that clicking the "Cancel" button when running the scripts from the script menu (not as a rule action) will actually stop the script when using a non-English version of the script.
- The scripts now open the Read Me file instead of a generic window telling that no help is available when selecting "Help" from the menu.
- Another change to the Installer so that we can handle script names with Unicode characters (like the ones used in the Greek version). This should make future localizations to non-Latin languages easier. Another upside of this change is a speed increase of the Installer, the downside is that the Mail Scripts distribution is slightly bigger now.
- Various small localization updates and fixes.
2.6.2 (March 17, 2005)
Improvements/bugfixes:
- (Archive Messages): fix various display problems with the export options when displaying it for a second time after cancelling the first operation.
- (Create Rule): fix "The variable theNewBox is not defined. (-2753)" when creating a new mailbox for move or copy actions.
- (Create Rule): make sure not to throw two error messages when no message has been selected when running the script.
- Installer fixes:
- The installer now should work again for users with FileVault enabled.
- Make the Mail Scripts folder and scripts group-readable. This should prevent duplicate installations when installing from different user accounts.
- A much nicer application icon courtesy of Yoram Blumenberg.
2.6.1 (March 1, 2005)
Improvements/bugfixes:
- (Create Rule): Fix error "Finder got an error: Can't get every file of folder "Sounds" of folder ... (-1728)" when no custom sounds are installed for the current user.
- Fix some problems with the installer failing with generic AppleScript errors when the user's disk name contained certain Unicode characters.
2.6 (February 21, 2005)
New features:
- (Archive Messages): Messages can now be exported to RTF files, including attachments
Note: since the "Save as RTF" from Mail is not accessible with AppleScript, the RTF files are generated by the script itself. This has several improvements over the RTF files generated by Mail:
- The generated files are about 35% smaller
- More formatting features from HTML and text/enriched messages are preserved
- Files embedded in multipart/related messages (e.g., embedded pictures in HTML messages) are preserved
Improvements/bugfixes:
- (Archive Messages): Make sure we don't write UTF-16 strings to exported mbox files since most programs will not be able to handle those.
2.5.4 (February 14, 2005)
Improvements/bugfixes:
- (Archive Messages): Improve Unicode-awareness of the script. When exporting to plain text files, the script should now produce the correct output for all messages regardless of the character encoding used (tested to work on a Japanese system with Japanese messages and on my Russian spam...). Make sure that we don't write Unicode byte-order marks in the middle of the export files since these would be interpreted as non-breaking spaces (or show up funny if the current font does not support that character).
- (Archive Messages): Several formatting improvements to generated text from text/html or text/enriched parts.
- The Installer now works correctly on Japanese systems (many thanks to Tetsuro Kurita for telling me about issues on Japanese systems and helping me debug and fix those issues).
- Make sure that the Installer correctly removes the English versions of the script menu scripts when installing a localized version over a previous non-localized version of the scripts.
- Some corrections to the Dutch localization.
2.5.3 (February 6, 2005)
Improvements/bugfixes:
- (Add Addresses, Archive Messages, Create Rule, Remove Duplicates): Fix error "Mail got an error: NSReceiverEvaluationScriptError: 4" when building the mailbox list or getting properties of the selected message at startup of the script. This would happen for certain mailboxes which cannot be accessed via AppleScript (e.g., mailboxes whose name ends in ".mbox"). These mailboxes will not show up in the mailbox selection list anymore - you will have to rename them to be able to run the script on these mailboxes.
- (Add Addresses, Archive Messages, Create Rule, Remove Duplicates): Mailboxes for accounts which are disabled in Mail's preferences (Accounts→Advanced) will be ignored.
- (Archive Messages): Exported plain text files are now written in Unicode (UTF-16). That way we should not drop random non-ASCII characters any longer (use Unicode::String instead of Unicode::Map8 for encoding conversions since this is much less lossy).
- (Archive Messages): Make sure we don't inline attachments with a Content-Disposition: attachment header.
- (Archive Messages): When exporting multiple messages into a single text file, the messages will now be sorted by date sent (oldest first). Note: when exporting messages from multiple mailboxes into a single file without preserving the hierarchy, the messages will be sorted by mailbox first and then by date sent.
- (Create Rule): Fix error "The variable i is not defined" when creating a rule with a move or copy action in case the rule was run on a message on a mailbox other than the Inbox and that mailbox was selected as the target mailbox.
- (Schedule Delivery): Fixed scheduling for months with less days in it than the current date (e.g., you weren't able to schedule any sending for February after the 29th of any month before)
- (Export Addresses): Don't write an empty line at the beginning of the exported contacts if no column titles were selected for the export.
- The Installer shouldn't produce an empty Applications folder in the user's home folder any more unless this is really required (i.e., installation for a non-privileged user without permission to write to the global Applications folder).
2.5.2 (January 21, 2005)
New features:
- French localization courtesy of Sébastien Marty.
- Italian localization courtesy of Marcello Teodori.
Improvements/bugfixes:
- (Add Addresses): Make sure that the progress bar is visible when adding the addresses to the Address Book so that we can see that the script is still working and estimate when it will finish.
- (Archive Messages): Make sure that we don't create any files or folders starting with a "." when exporting messages to disk - the Finder won't like this...
- (Archive Messages): Fixed bug with improper selection of read and flagged status.
- (Archive Messages): Updated to latest versions of MIME::Tools (5.417) and MailTools (1.66).
- (Search Addresses): Fix searching in birthdays - before only "is empty" worked properly, now all the searches should be fine.
2.5.1 (January 8, 2005)
Improvements/bugfixes:
- Fixed a bug in the Installer which would result in an AppleScript error when trying to install on a non-English system version
Note: This release does not contain any changes to the actual scripts - you only have to install it if the installer for 2.5 failed
2.5 (January 7, 2005)
New features:
- Filter Sent Messages - new script (located in the scripts menu in Mail) which will apply your rules to all your sent messages. This helps you file your sent messages automatically.
Improvements/bugfixes:
- (Archive Messages): Fixed bug when archiving multiple mailboxes while preserving the hierarchy which would result in an AppleScript error before ('Can't make «class mbxp» "MailboxName" of «class mact» "AccountName" of application "Mail" into a Unicode text (-1700)').
- (Archive Messages): Make sure that exported messages in mbox format actually do conform to the mbox standard. Since messages on IMAP servers apparently don't start with the initial line required by the mbox file format, we add one during export.
- (Archive Messages): Changed structure of internal mailbox cache - archiving messages in 2.4.3 could in some cases lead to the wrong mailbox(es) being archived (since the cache got confused after adding the Archive mailbox).
- (Archive Messages): Updated to the latest version of HTML::Parser (3.45).
- (Search Addresses): Fixed error 'Can't get character 1 of ""' when searching Address Book fields and specifying "is empty" or "is not empty."
2.4.3 (December 16, 2004)
Improvements/bugfixes:
- (Archive Messages): Updated to the latest version of HTML::Parser (3.43).
- (Schedule Delivery): Worked around a race condition in order to avoid the dialog "Please save your messages as drafts..." which sometimes would appear after a successful scheduled sending of a message.
- (Archive Messages, Create Rule, Remove Duplicates): Made mailbox selection process more robust (we now cache the reference to the mailbox itself instead of trying to recreate it from its name).
- (Export Addresses): Fixed a bug which would make the script fail to export any addresses when no groups are present in the Address Book (Successfully exported "0 Address").
- (Export Addresses): When exporting multiple contacts with the same "full name" (e.g., multiple people within the same company which have been marked as "This is a Company" in the Address Book), the script would produce duplicates in the exported file - this has been fixed.
- (Export Addresses): Corrected wrong summary dialog (referencing "Archive Messages") in the German version.
- (Export Addresses, Search Addresses): Change "Title" to "Prefix" (in the English version of the scripts) in order to be consistent with the Address Book naming conventions.
- Several internal code optimizations for streamlining the localization process and sorting multi-dimensional lists.
2.4.2 (November 29, 2004)
New features:
- (Search Addresses): Added option to search for multiple values within the same field at once. One example of such a search would be finding all contacts in a local area by looking for a list of ZIP codes. See Usage for details of the new feature.
- (Search Addresses): Added searching of individual address fields (street, city, state, ZIP code, country).
Improvements/bugfixes:
- (Archive Messages): Fixed problem with options dialog not always reflecting the proper selection for the output structure.
- (Archive Messages): An empty "Archive Name" now works properly - when exporting into one file per message, no additional folder is generated inside the selected location; when exporting into a single file, the "Archive Name" is used instead of the default name inside a folder with the archive name.
- (Archive Messages): Make sure to limit the maximum length for the filename to 255 characters when exporting into on file per message.
- (Archive Messages): Updated to latest versions of HTML::Parser (3.40) and MailTools (1.65).
- (Search Addresses): Make sure to clean the previous result list when "Modify Search" or "New Search" are chosen after a search.
2.4.1 (October 30, 2004)
Improvements/bugfixes:
- (Archive Messages): When exporting into text files with the option "One File per Message", we now make sure to create a new file for each message even if there is more than one message from the same person with the same subject on a given day.
- (Archive Messages): Updated to latest version of MIME::Tools (5.415).
2.4 (October 21, 2004)
New features:
- (Archive Messages): When exporting messages (to either text or mbox files), you can now select to have one file per message. In this case, the file name will be comprised of the sender name, date sent, and message subject.
- (Archive Messages): When exporting messages to text files, you can now choose whether you want long lines to be broken, specifying the maximum number of characters per line (message quote levels will be preserved).
Improvements/bugfixes:
- (Add Addresses): Moved the code to check whether the Address Book is running to the proper place so that it actually works. We now also quit the Address Book unless it has been running when the script was started and the user selects "Cancel" to abort the script or simply closes its window.
- (Add Addresses): Fixed error "Can't get item 0 of {}" for users which didn't have any groups defined in the Address Book.
- (Archive Messages): When exporting to plain text files, we now use our own text parser for all messages (even text/plain) in order not to lose message quotes (AppleScript's "get content of message" will strip the quote chars from the beginning of each line).
- (Archive Messages): Fixed problem when exporting messages encoded with UTF-8 to plain text files.
- (Archive Messages): Added quoting for text/enriched messages when exporting to plain text files (quote level is given by the <excerpt> tags inside the message).
- (Archive Messages): Updated to latest version of MIME::Tools (5.414).
- (Change SMTP Server): It is now possible to change all accounts to a new SMTP server without having to choose the corresponding entry for each of the accounts in the list.
- (Schedule Delivery): Made the script independent of the date format set in the System Preferences - we should not get the error "Invalid date and time 1/1/2004" any more.
2.3.2 (October 3, 2004)
Improvements/bugfixes:
- (Archive Messages): When exporting messages as plain text, make sure to use the proper character encoding in the Perl script for messages not handled by Mail so that non-ASCII characters now show up properly in all cases (use Unicode::Map8 from CPAN for this).
- (Archive Messages): When exporting messages as plain text, handle <blockquote> in HTML messages (start lines with proper level of "> ") to make it easier to distinguish the original message from included quotes.
- (Archive Messages): Fixed "Mail got an error: NSReceiverEvaluationScriptError: 4 (1)" error which would occur when trying to export a message with no "Content-Type:" header to plain text.
2.3.1 (September 30, 2004)
Improvements/bugfixes:
- An improved quick sort implementation used in 2.3 broke some things (e.g., the "Add Addresses" script was returning "The variable theGroups is not defined. (-2753)") - fixed this.
2.3 (September 29, 2004)
New features:
- (Archive Messages): when exporting messages into text files, richt text and HTML messages are now exported as well. Since Apple has still not fixed the bugs in Mail's AppleScript implementation, I wrote my own parser to generate plain text versions. The parser is written in Perl and relies heavily on two modules from the CPAN archive: MIME::Tools and HTML::Parser. Since both these packages are not part of the standard system installation, they are packaged within the application itself.
The parser has the following specifications:
- For multipart/alternative messages, the "text/plain" part is used
- "text/html" and "text/enriched" parts will be converted to a plain text version, trying to preserve formatting as much as possible
- Links inside <a> tags in "text/html" messages will be extracted and inserted next to the link text
- Attachments and pictures will be referenced within the message, if possible showing their name and location
Improvements/bugfixes:
- The Installer now works even for users who have FileVault enabled. Note: since Apple decided to break lots of things in AppleScript when FileVault is enabled, some of the scripts might still not work (see known issues)
2.2.5b - Maintenance Release (September 4, 2004)
Improvements/bugfixes:
- More fixes to the installer in order to prevent the "NSArgumentsWrongScriptError (6)" message some users had been getting
Note: This release does not contain any changes to the actual scripts - you only have to install it if the installer for 2.2.5 failed
2.2.5 (August 31, 2004)
Improvements/bugfixes:
- (Change SMTP Server): Make sure that accounts set up using the httpmail-plugin (hotmail.com, msn.com) will not show up in the list since they don't use a real SMTP server for sending mail. Looks like a change in the httpmail-plugin broke the earlier solution...
- Major re-write of the Installer - this should have the following advantages:
- A few people reported problems with the previous Installer failing - the new Installer seems to work for those people
- The Installer now works even when the BSD subsystem is not installed
- Since the Installer will no longer dynamically build some of the scripts, speed is much improved
2.2.4 (August 29, 2004)
Improvements/bugfixes:
- (Add Addresses): Quit the Address Book after adding the new addresses unless it has been running before the script started
- (Change SMTP Server): Rewrote the script to allow changing to different SMTP servers for individual accounts in a single run
- (Create Rule): Added ability to choose custom sounds installed in ~/Library/Sounds/ for the "Play Sound" action
- (Search Addresses): Fixed problem with the delete button for search criteria not working in certain situations
- Fixed problem with the Installer which could lead to duplicated installations when upgrading to a new version
- Upgraded project to Xcode 1.5, taking advantage of some new features (native targets, additional code optimizations, ...)
- Some cosmetic improvements (e.g., button size within tables decreased)
2.2.3 (July 9, 2004)
Improvements/bugfixes:
- The Installer now installs the scripts into the current user's application folder (~/Applications/) instead of the global applications folder if the current user does not have admin rights.
- (Schedule Delivery): Fixed a problem which could result in an error message being displayed when more than one mail was scheduled to be sent at the same time.
2.2.2 (June 16, 2004)
New features:
- (Remove Duplicates): Added option to "Ignore Headers" when comparing duplicate messages. This is option will test for duplicates based on Message-ID and message content (ignoring white space) and provides a little more relaxed definition of duplicates.
Improvements/bugfixes:
- Worked around a problem introduced by the Apple Security Update 2004-06-07 which could result in an error -10814 when running the scripts from the scripts menu (thanks to Benjamin Han for a enlightening discussion about and solutions to this problem!)
- Fixed an Installer problem which would erroneously report a missing BSD subsystem for some users (thanks to Paul Jones and Web Maestro Clay in helping me track down this issue!)
- (Open Mailbox): The script should now work more reliably when the mailbox to be opened is an account inbox (i.e., running the script without a "Move Message" action in the rule)
2.2.1 (May 23, 2004)
New features:
- (Create Rule): You can now select "Any Recipient" as rule condition for any of the addresses in the currently selected message
Improvements/bugfixes:
- (Export Addresses): Internal code clean-up for enabling checkboxes in the export field selection
- (Open Mailbox): Fixed several bugs which would prevent the script to work properly in some cases
2.2 (May 20, 2004)
New features:
- Open Mailbox - new script (located in the scripts menu in Mail) which - when run as a rule action - will open a new window showing the mailbox where new incoming messages have been moved to
- Open Message - new script (located in the scripts menu in Mail) which - when run as a rule action - will open new incoming messages in their own windows
- (Create Rule): Added "Stop evaluating rules" to the list of possible rule actions
Improvements/bugfixes:
- (Add Addresses, Export Addresses): The script should now be able to deal with spurios groups which don't have a name without getting an AppleScript error
- (Remove Duplicates): Move duplicates immediately after they are found instead of at the end of processing a mailbox. This will enable you to pick back up where you left in case AppleScript or Mail decide to throw an error.
2.1.7 (May 9, 2004)
Improvements/bugfixes:
- (Add Addresses): Fixed problem with parsing names which would result in an error message for some addresses in mails sent from Outlook
- (Archive Messages, Remove Duplicates): Disable automatic mail checks while the script does all its work in order not to put too much load on Mail
- (Change SMTP Server): Get rid of the AppleScript error "The variable SMTPName is not defined." for users having the httpmail plugin installed (the plugin creates dummy SMTP accounts which are lacking some of the required information and fail to return some properties)
- (Remove Duplicates): Make sure that the counter in the main window and the dialog at the end will always display the correct number of duplicates found
- If a previous version of the scrips was installed at a location different from the standard one, the Installer will now try to update the files at that location. This should prevent duplicate versions and the possibility of launching an old version of the scripts
2.1.6 (April 26, 2004)
New features:
- (Search Addresses): Double-clicking a name in the result list will now open the contact's card in the Address Book
Improvements/bugfixes:
- (Create Rule): If the script is run on a message located in a mailbox other than the InBox, the mailbox will be preselected for the "move" and "copy" commands to avoid loading the entire mailbox hierarchy unless needed
- (Create Rule): Make sure that no duplicate addresses will show up in the criteria list for messages having identical addresses in the various headers
- (Remove Duplicates): Duplicates will now be found within IMAP and .Mac mailboxes as well (a different format of the local IMAP cache had prevented this before)
- (Send all Drafts): Messages which are still being edited (auto-saved drafts created from messages still being edited in an open window) will now no longer be sent when running this script
- The Installer now updates the Launch Services database after installing the Scripts - this should prevent the message "Finder got an error: An error of type -10814 has occurred. Do you want to edit this script?" from appearing when running the scripts from the script menu for users installing "Mail Scripts" for the first time
2.1.5 (April 17, 2004)
New features:
- (Create Rule): Add popup button to select location for the newly created rule in relation to the rules already present
- (Create Rule): Made all sender and recipient addresses available for both send and receive rules to facilitate easier rule setup
Improvements/bugfixes:
- (Archive Messages, Remove Duplicates): Improved startup time by showing all mailboxes instead of only mailboxes containing messages. This should (hopefully!) get rid of the "AppleScript timeout" problem
- (Create Rule): Fixed problem which could make the script produce an AppleScript error and stop working when trying to move or copy to a mailbox whose name contained certain unicode characters
- (Create Rule): Fixed bug which would prevent the script from setting one of the the standard Mail sounds as a rule action.
- Fixed bug which could result the scripts to hang if the user clicked into a list during lengthy operations
- Speed up and streamline the Installer
2.1.4 (March 20, 2004)
New features:
- (Archive Messages): Added option to change the default name for the archive mailbox and export folder. This allows archiving/exporting to the same mailbox/folder every time. Custom names will be remembered between runs - to restore the default naming (with the current date) select an empty name
- (Add Addresses): Added popup button to select the label to be used for the imported addresses in the Address Book
Improvements/bugfixes:
- (Remove Duplicates): Make progress bar and "Cancel" button somewhat more responsive during message comparison
- (Add Addresses): Corrected problem which would result in an AppleScript error message ("The variable theGroups is not defined. (-2753)") when no groups are defined in the Address Book
2.1.3 (March 10, 2004)
Improvements/bugfixes:
- (Add Addresses): Change lookup of email addresses in the Address Book to case-insensitive
- (Archive Messages): Revert output location to default value in case the last export has been made to a folder no longer present on the system in order to avoid "folder not found" error messages
- (Schedule Delivery): Make checking for whether iCal is running or not a little quicker and more robust in order to avoid a Finder error
- Various internal script improvements and clean-up
2.1.2 (March 3, 2004)
Improvements/bugfixes:
- (Export Addresses): Fixed bug which would result in the AppleScript error message "Can't make month of missing value into a string. (-1700)" when trying to export birth dates for people which didn't have one entered
- (Archive Messages, Remove Duplicates): Speed up initial loading of mailboxes
- (Remove Duplicates): Tried to work around all AppleScript timeout errors and make script a little faster and more responsive
2.1.1 (February 1, 2004)
Improvements/bugfixes:
- (Schedule Delivery): Fixed bug which would result in the AppleScript error message "The variable theWindow is not defined. (-2753)"
- (Schedule Delivery): Corrected typo in the Dutch localization
2.1 (January 31, 2004)
New features:
- Schedule Delivery - automatically send messages at a later time. Every message in the Drafts can be individually scheduled to be sent at a specific time
2.0.2 (January 5, 2004)
New features:
- Dutch localization courtesy of Guy De Lee
- The names of the scripts are now localized, both in the Finder and in the Scripts menu (the localization in the Scripts menu uses the current user's preferred language setting at the time of installation)
Improvements/bugfixes:
- Notify the user during installation if the BSD package is missing instead of displaying some obscure generic AppleScript error
- Corrected some tool tips in the various scripts
- Made some improvements when selecting mailboxes with accented characters in their name (there seems to be some bug in Mail's AppleScript implementation)
- (Archive Messages, Remove Duplicates): speed up scanning of mailbox hierarchy in order to avoid script timeout errors which could occur for mailboxes with many messages in them
- (Remove Duplicates): completely re-wrote the script making use of some command line tools. This greatly improves the speed of the script and should avoid various AppleScript errors which could appear before (NSCannotCreateScriptCommandError (10), NSReceiverEvaluationScriptError (4), and NSInternalScriptError (8) were reported before)
2.0.1 (December 27, 2003)
Improvements/bugfixes:
- Fixed some problems which would prevent the installer from installing the launch scripts at the proper location (they would end up on the HD's root directory instead) and various AppleScript errors with the installer when FileVault was turned on
Note: There is no need to download the new version if the installer worked for you before, there are no changes to the scripts themselves
2.0 (December 26, 2003)
New features:
- All scripts have been completely rewritten as AppleScript Studio applications and now require MacOS X 10.3 or higher. (Since the AppleScript dictionaries of 10.2.x and 10.3.x for Mail and Address Book are not compatible with each other, Mail Scripts 2.0 will not run on system versions before 10.3 and I won't be able to write a version able to run on 10.2.x either...)
- All scripts now have interfaces giving the user feedback about the current status. The new GUI should also be much more straightforward, utilizing single dialogs instead of a succession of several dialogs for the individual options.
- Scripts are installed into the application-specific script menus for Mail and Address Book making the system-wide scripts menu unnecessary for the operation of Mail Scripts
- In addition to the standard English interface, the scripts have been completely localized in German - please contact me if you want to help localizing to other languages
Improvements/bugfixes:
- "quick sort" is now used for all sorting done inside the various scripts (instead of the simple ASCIISort used before) - this speeds up sorting on long lists considerably (quick sort scales with O(n log n) whereas ASCIISort scales with O(n2). Many thanks to Markus Kaspar for providing the original AppleScript implementation of quick sort)
- (Add Addresses - renamed from Manage Mailing Lists): Full name information is now added for new contacts; the script should parse most name formats properly and put the information in the correct fields
- (Archive Messages): Consolidated "Archive Messages" and "Export Messages" into a single script. Messages can now be also selected based on their read and flagged status.
- (Create Rule): Updated to support new rules actions introduced in Mail with MacOS X 10.3
- (Remove Duplicate Messages): Improved speed and hopefully prevent a possible stack overflow in AppleScript which would manifest itself by the error message "The variable theHeaders is not defined". In my tests, the script ran fine on a total of more than 10,000 messages - string handling in AppleScript is not exactly fast though...
- (Send all Drafts): Drafts with attachments will now be send as well, the attachments will be preserved
- (Export Addresses): Updated to support new fields introduced with MacOS X 10.3
- (Export Addresses): Output files will now be sorted according to the preference setting "Display Order" in the Address Book
- (Search Addresses): Updated to support new fields introduced with MacOS X 10.3
- (Search Addresses): Display search results within the script - creating a group from the search results is now an option.
1.3.7 (February 8, 2003)
Improvements/bugfixes:
- (Export Addresses) the addresses in the output file are now sorted alphabetically (by last name, then first name)
1.3.6 (February 2, 2003)
New features:
- (Manage Mailing List - renamed from "Create Mailing List") present the user with a list of groups already present so you don't have to enter the group name to update an existing group
- (Export Messages) added option to export multiple messages into a single text file in order to create a message digest
Improvements/bugfixes:
- (Export Addresses) convert new-line characters in street addresses to ", " in order to create a properly formatted text file
- (Export Messages) fixed a problem which would cause the script to stop when trying to export a message without a subject. These messages will now have "<No Subject>" in their file name
- (Export Messages) when exporting messages with the same subject and the same date, create individual files for each message instead of appending subsequent messages to the first file (starting with the second message, files will have a number appended to their filename)
1.3.5 (December 29, 2002)
Improvements/bugfixes:
- (Export Messages) added an option to export only minimal headers ("To:", "From:", "Cc:", "Bcc:", and "Subject:") when writing to text files
- (Export Messages) fixed a problem where the script would give an error message ("Bad name for file" or "File ... wasn't found") when the message subject contained certain characters and the messages was exported into a text file
1.3.4 (December 3, 2002)
Improvements/bugfixes:
- (Export Addresses) removed the additional tab character which was added to the beginning of every line
- (Send all Drafts) messages in the drafts folder which contain attachments will be skipped - there is no way of accessing attachments from AppleScript and the attachments would be lost when trying to send those messages
1.3.3 (November 28, 2002)
New features:
- (Export Messages) - added option to export messages as text files (one file per message) instead of mbox files
Improvements/bugfixes:
- (Create Mailing List) fixed a problem which would produce an AppleScript error when trying to add addresses to a mailing list which were not already present in the Address Book (this error probably appeared due to the new feature in Address Book with MacOS X 10.2.2 which now shows the email address instead of <No Name> for email-only entries)
1.3.2 (November 10, 2002)
New features:
- (Search Addresses) - entering "*" as the search value will now find any non-empty values in that field (wildcard search)
Improvements/bugfixes:
- (Export Addresses) removed additional header "Name" which was written to the output file
- (Export Addresses) corrected mismatch between data and column headers (reversed order of zip code and state)
1.3.1 (October 13, 2002)
Improvements/bugfixes:
- (Export Messages) fixed problem which would produce an error when trying to export all messages
- (Export Messages, Archive Messages) slight speed improvement when exporting/archiving messages independent of the message age
1.3 (October 11, 2002)
New features:
- Archive Messages - move messages from the selected mailbox(es) to an archive mailbox. You can select to move all messages or only messages older than a certain number of days
- Export Messages - export messages to standard mbox files for backup purposes or to import them into other mail programs
Improvements/bugfixes:
- Save preferences independently of the BSD subsystem by using script properties. This made the code smaller and safer
- (Export Addresses) added option to export all contacts at once
- (Export Addresses) renamed some of the column headers in the output file to ease import into Entourage
- (Remove Duplicate Messages) move the duplicates to a mailbox called "Duplicate Messages" located at the root of your mailboxes instead of deleting them immediately
- (Create Rule) added option to create a mailbox on the fly when making a new "Transfer" rule. The new mailbox will be located at the root level of your mailboxes
1.2.2 (October 9, 2002)
Improvements/bugfixes:
- We finally should never get messages like "Cannot convert '10.2.1' into a number" any more
- Fixed a problem where the user would be presented with a cryptic error message when the BSD subsystem was not installed. We now tell the user about the missing BSD subsystem upon installation (the scripts still work but no preferences will be saved)
1.2.1 (September 22, 2002)
Improvements/bugfixes:
- Fixed a problem which would manifest itself in the display of the message "Could not parse [...] try single quoting it." when running "Change SMTP Server" and some of the accounts had spaces in their name
1.2 (September 22, 2002)
New features:
- Send all Drafts - immediately send all messages in the "Drafts" folders for all accounts
- Remove Duplicate Messages - delete all duplicate messages found in the selection
- Search Addresses - find all addresses inside the Address Book matching one or more criteria
Improvements/bugfixes:
- New folder layout so we don't clutter the Script Menu
- Save all scripts as applications so that they can be run from any location and not just the Script Menu
- Added some more error checking to the installer script
- (Create Rule) show IMAP folders and subfolders inside the standard mailboxes (In, Out, ...) for "Transfer..." rules
- (Export Addresses) let the user decide whether to include the full name in the output file
- (Export Addresses) reverse order of ZIP and city in the output file
1.1.1 (September 15, 2002)
Improvements/bugfixes:
- Work around the 'Cannot convert "10.2" to a number' problem. This happened when the decimal separator in the System Preferences was set to anything other than "." (e.g., the standard setting in Germany is ",")
1.1 (September 14, 2002)
New features:
- Add an install script for easy installation of the scripts
- Export Addresses - export addresses from the Address Book into tab-delimited text files
- Create Mailing List - create and update mailing list from all addresses found in the selected messages
Improvements/bugfixes:
- Sort the list of mailboxes when creating "Transfer..." rules
1.0 (September 13, 2002)
Initial release ("Create Rule" & "Change SMTP Server")