On 11 Feb 2016, at 14:42, Ale Muñoz wrote:
Here's what I want to do:
- Take the subject from the selected email
- Extract some information from it using a RegExp
- Search the current mailbox for all emails that contain that RegExp
and delete them
Any ideas? Thanks in advance! : )
This is actually possible using custom key bindings, but it appears it's
only documented in some very old release notes. I've noted to make sure
it's documented:
Here is an example:
( "selectWithFilter:", "subject ~ '${subject/[^\\d]*(\\d+).*/$1/}'",
"deleteMessage:" );
In this case I'm extracting the first number found in the subject line
of the currently selected message. All subject lines in the current
mailbox are then searched for the same number.
Observations:
* It's tricky to debug. I suggest using the format/regexp string for one
of the menu bar counters until the menu displays the values you need to
extract. Then make sure you escape (add another `\`) any uses of `\`
before adding it to the key bindings file.
* It's badly named. It should be `selectWithFormatString:`. I've added
that this also works.
* It doesn't allow you switch mailbox before selecting messages (not
easily fixed).
* The above example would also match on substrings of numbers.
But it seems it should work for you.
--
Benny
_______________________________________________
mailmate mailing list
mailmate@lists.freron.com
http://lists.freron.com/listinfo/mailmate