[MlMt] Deleting large numbers of items

Benny Kjær Nielsen mailinglist at freron.com
Wed Jan 22 08:49:16 EST 2014


On 21 Jan 2014, at 22:27, Kee Hinckley wrote:

> Short of the addition of the ability to launch a piece of AppleScript 
> or a Bundle with the current selection, I can't think of any way to do 
> this. But I wanted to put it out there as a suggestion. (Is it 
> possible to do either of those things?)

Initial reaction was no. Then perhaps. Then probably. Then yes, except 
for a bug in the code handling notifications.

You could add a rule to the destination mailbox running a bundle command 
which looks something like this:

~~~
{
	name    = 'Notify';
	input   = 'formatted';
	formatString = "${#body-part-id}\n";
	output  = 'actions';
	executionMode = multipleMessages;
	script  = '#!/bin/bash
count=`wc -l | tr -d " "`
if [ "$count" -gt "5" ]
then
	printf "{ actions = ( { type = notify; formatString = \\\"Moving 
${count} messages from \\${from.name}\\\"; }, { type = playSound; path = 
\'Basso.aiff\'; } ); }"
fi
';
	uuid = '4BCAA993-94F6-4F14-B90A-E9DA5A854CBD';
}
~~~

The script is inlined which makes it a bit ugly (a lot of escaping), but 
the logic is simple. If there is more than 5 lines in the input (1 
message per line) then tell MailMate to show a notification and play a 
sound. The sound works now, but I don't think the notification works 
properly before the next update of MailMate is out. The `formatString` 
for the notification is based on the first message in the set.

Of course, this is going to be shown independently of your action. Any 
large number of messages moved to the mailbox is going to trigger it.

(And there is a general issue with notifications on Mavericks when Growl 
is not installed I believe.)

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20140122/4c866094/attachment.html>


More information about the mailmate mailing list