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
[email protected]
https://lists.freron.com/listinfo/mailmate

Reply via email to