[MlMt] Set a tag in a bundle

Benny Kjær Nielsen mailinglist at freron.com
Wed Jan 16 05:15:36 EST 2019


On 13 Jan 2019, at 12:52, leo wrote:

> I’ve changed the devonthink-pro bundle a little bit (Corrected the 
> Mofied date), but I really would like to add a feature to **tag the 
> message in MailMate automatically on export to DEVONthink with a fixed 
> tag** (“in-devonthink”).
>
> How could I achieve this? Do I set the output key to actions and then 
> create in the add bash script an property list on stdout with the 
> changeFlags type?

Yes.

> Does anybody have an example for something like this in one of the 
> bundles?

Here's one using the support for JSON in more recent versions of 
MailMate:

~~~
#!/usr/bin/python
import json

actions = { 'actions': [ { 'type': 'changeFlags', 'enable': [ 'AddThis', 
'AndThis' ], 'disable': [ 'RemoveThis' ] } ] }
print json.dumps(actions)
~~~

Here's a more crude approach outputting a raw property list in a bash 
script.

~~~
cat << ENDL
{
	actions = (
		{
			type = 'changeFlags';
			enable = ( "AddThis", "AndThis" );
			disable = ( "RemoveThis" );
		},
	);
}
ENDL
~~~

Note that the “flags” must be the IMAP keywords used for the tags 
(and not the display names).

Alternatively, setup a custom key binding which calls the bundle command 
*and* changes the tag.

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


More information about the mailmate mailing list