On 16 Dec 2014, at 14:32, [email protected] wrote:

I want to customize the file name string when dragging a mail to the Finder. I’ve seen that some string formatting can be done with "defaults write com.freron.MailMate MmFilenameFormatString …"

What I want to achieve is this:

<formatted time> <subject> <[author]>.eml

Example:

141209T1848 Dont’t forget to take out the trash [John Doe].eml

I can at least point you in the right direction. Here is the most straightforward way to get something like that:

defaults write com.freron.MailMate MmFilenameFormatString -string '${#date} ${subject} [${from.name:${from.address}}].eml' -> 2014-12-16 14;32;50 +0100 [MlMt] MmFilenameFormatString question [[email protected]]-1.eml

The problem with `;` is because `:` cannot be part of a filename. Note that the name of the sender is used if it exists, but it didn't for your email.

Slightly better perhaps:

        '${#date.formatted} ${subject} [${from.name:${from.address}}].eml'
-> 16 Dec 2014 14;32 [MlMt] MmFilenameFormatString question [[email protected]].eml

Using a regular expression substitution, you can do something like this:

        '${#date/://g} ${subject} [${from.name:${from.address}}].eml'
-> 2014-12-16 143250 +0100 [MlMt] MmFilenameFormatString question [[email protected]]

And it gets a bit more hairy to get somthing closer to what you wanted:

'${#date/(\S*) (\d\d):(\d\d).*/$1T$2$3/} ${subject} [${from.name:${from.address}}].eml' -> 2014-12-16T1432 [MlMt] MmFilenameFormatString question [[email protected]].eml

I hope this helps and thanks for trying out MailMate.

--
Benny
_______________________________________________
mailmate mailing list
[email protected]
http://lists.freron.com/listinfo/mailmate

Reply via email to