<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/applescript</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 17 May 2008 11:51:46 GMT</pubDate>
<item>
<title>(AppleScript) Auto-tag, auto-file script for Mail.app, Address Book, MailTags - paulhagstrom</title>
<link>http://snipplr.com/view/5236/autotag-autofile-script-for-mailapp-address-book-mailtags/</link>
<description><![CDATA[ <p>A few weeks ago, I created an Applescript to simplify my use of Mail Act-On using MailTags. I've been using it since then and it seems to be working pretty reliably (but see note below), so I thought I'd share it in its current state.

What it does is leverages information from Address Book to determine where a message should be filed, so that it is not necessary to create an individual Mail rule for each one. The main reason I did this is that I did not want to keep each sender's list of alternative email addresses both in Address Book and in a Mail rule, since any changes would then need to be made in both places.

What it does is scan through the senders and recipients and looks in Address Book to see if it can find a match. If it does, it checks the Notes field for that person to see if it finds the text "autobox:" or "autotag:", and if it does, it will move the message (autobox), or tag the message (autotag), or both. I also had it check groups that found records are in, so that you can create groups of people that will be autofiled or autotagged. Since groups don't have "notes" fields, the trigger needs to be in the group name. The comments to the script elaborate the usage in more detail. I have not added automatic assignment of projects, but it is an easy extension, which when I have a chance I might add myself. It can be run in several modes, based on the name of the rule that calls it. I have set up four rules, all of them calling the script, but when the rule has "sender only" in its name, the script will check only the sender, and when the rule has "recipients only" in its name, the script will check only the recipients, etc. (see the code comments). I assigned a different MAO key to each of these rules (1, 2, 3, and 4, in fact), and use the one most appropriate to the email I'm trying to autotag and autofile.

The note I wanted to add about the reliability of this is this: It generally seems to work, I haven't had any problems that I can certainly pin on this script. However, I have a couple of times had Mail flip out on me just after running this script, putting up a dialog saying that it has to quit now, and re-import the messages upon restart (that is, the envelope index got corrupted somehow). This is a pain, I have 180k messages in my local files, and reimporting (which means just rebuilding the envelope index file) takes a long time.

I am kind of a novice at Applescript, so there may be various ways in which this script could be improved -- and I'd be happy to hear about them. Any speculation about what might have the consequence of corrupting the envelope index would also be very welcome. As I say, it may have nothing to do with this script, but it just happened to occur both times I've seen it recently after running the script (on a message that was already where it was supposed to be -- that is, running this a second time on the same message).</p> ]]></description>
<pubDate>Thu, 28 Feb 2008 11:05:20 GMT</pubDate>
<guid>http://snipplr.com/view/5236/autotag-autofile-script-for-mailapp-address-book-mailtags/</guid>
</item>
<item>
<title>(AppleScript) Get the Count of unread Messages in Vienna (RSS-Reader) - zingo</title>
<link>http://snipplr.com/view/4991/get-the-count-of-unread-messages-in-vienna-rssreader/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 11 Feb 2008 14:35:45 GMT</pubDate>
<guid>http://snipplr.com/view/4991/get-the-count-of-unread-messages-in-vienna-rssreader/</guid>
</item>
<item>
<title>(AppleScript) MacOS X - set correct time AppleScript - heinz1959</title>
<link>http://snipplr.com/view/4302/macos-x--set-correct-time-applescript/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 11 Dec 2007 03:01:06 GMT</pubDate>
<guid>http://snipplr.com/view/4302/macos-x--set-correct-time-applescript/</guid>
</item>
<item>
<title>(AppleScript) Wowhead Search Colloquy Plugin - raws</title>
<link>http://snipplr.com/view/3965/wowhead-search-colloquy-plugin/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 21 Oct 2007 23:40:42 GMT</pubDate>
<guid>http://snipplr.com/view/3965/wowhead-search-colloquy-plugin/</guid>
</item>
<item>
<title>(AppleScript) Ping Google and display result in quicksilver - dbug13</title>
<link>http://snipplr.com/view/2834/ping-google-and-display-result-in-quicksilver/</link>
<description><![CDATA[ <p>I use this to test if my internet connection is up, I run it from quicksilver, it's much faster for me than opening up a terminal.</p> ]]></description>
<pubDate>Sun, 10 Jun 2007 21:29:56 GMT</pubDate>
<guid>http://snipplr.com/view/2834/ping-google-and-display-result-in-quicksilver/</guid>
</item>
<item>
<title>(AppleScript) Unix/HFS path conversion - miklophone</title>
<link>http://snipplr.com/view/2752/unixhfs-path-conversion/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 29 May 2007 04:23:05 GMT</pubDate>
<guid>http://snipplr.com/view/2752/unixhfs-path-conversion/</guid>
</item>
<item>
<title>(AppleScript) codigo - michoacano</title>
<link>http://snipplr.com/view/1928/codigo/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 04 Jan 2007 16:07:32 GMT</pubDate>
<guid>http://snipplr.com/view/1928/codigo/</guid>
</item>
<item>
<title>(AppleScript) Quicksilver: Grab Selection - jonathanbp</title>
<link>http://snipplr.com/view/1199/quicksilver-grab-selection/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 27 Sep 2006 08:31:09 GMT</pubDate>
<guid>http://snipplr.com/view/1199/quicksilver-grab-selection/</guid>
</item>
<item>
<title>(AppleScript) Loop until specified application quits - katz</title>
<link>http://snipplr.com/view/587/loop-until-specified-application-quits/</link>
<description><![CDATA[ <p>This example is the loop that waits until "mi.app" is quitted.</p> ]]></description>
<pubDate>Wed, 26 Jul 2006 05:29:11 GMT</pubDate>
<guid>http://snipplr.com/view/587/loop-until-specified-application-quits/</guid>
</item>
<item>
<title>(AppleScript) unmount Samba disk - katz</title>
<link>http://snipplr.com/view/312/unmount-samba-disk/</link>
<description><![CDATA[ <p>unmount Samba disk named "SHARE" if we have mounted it</p> ]]></description>
<pubDate>Sun, 09 Jul 2006 13:29:06 GMT</pubDate>
<guid>http://snipplr.com/view/312/unmount-samba-disk/</guid>
</item>
<item>
<title>(AppleScript) mount Samba disk - katz</title>
<link>http://snipplr.com/view/311/mount-samba-disk/</link>
<description><![CDATA[ <p>mount Samba disk named "SHARE" if we haven't mounted it</p> ]]></description>
<pubDate>Sun, 09 Jul 2006 13:27:41 GMT</pubDate>
<guid>http://snipplr.com/view/311/mount-samba-disk/</guid>
</item>
<item>
<title>(AppleScript) unmount disk image (*.dmg) file - katz</title>
<link>http://snipplr.com/view/310/unmount-disk-image-dmg-file/</link>
<description><![CDATA[ <p>In this case, if we have mounted GyazMail.dmg, unmount it.</p> ]]></description>
<pubDate>Sun, 09 Jul 2006 13:23:16 GMT</pubDate>
<guid>http://snipplr.com/view/310/unmount-disk-image-dmg-file/</guid>
</item>
<item>
<title>(AppleScript) mount disk image (*.dmg) file - katz</title>
<link>http://snipplr.com/view/309/mount-disk-image-dmg-file/</link>
<description><![CDATA[ <p>In this case, if we haven't mounted GyazMail.dmg, mount it.</p> ]]></description>
<pubDate>Sun, 09 Jul 2006 13:21:28 GMT</pubDate>
<guid>http://snipplr.com/view/309/mount-disk-image-dmg-file/</guid>
</item>
<item>
<title>(AppleScript) Get Mac File Type &amp;amp; Creator - splorp</title>
<link>http://snipplr.com/view/138/get-mac-file-type--creator/</link>
<description><![CDATA[ <p>Displays the file type and file creator designations for any Mac OS document or application.</p> ]]></description>
<pubDate>Fri, 30 Jun 2006 08:52:04 GMT</pubDate>
<guid>http://snipplr.com/view/138/get-mac-file-type--creator/</guid>
</item>
</channel>
</rss>