[MlMt] Set a tag in a bundle

leo mailmate at halloleo.hailmail.net
Wed Jan 16 05:29:38 EST 2019


Thanks a lot, Benny!

Will try the Python script out.

Cheers,
Leo

On 16 Jan 2019, at 21:15, Benny Kjær Nielsen wrote:

> 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


> _______________________________________________
> mailmate mailing list
> mailmate at lists.freron.com
> https://lists.freron.com/listinfo/mailmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20190116/665ff368/attachment-0001.html>


More information about the mailmate mailing list