[MlMt] MmFilenameFormatString question
Benny Kjær Nielsen
mailinglist at freron.com
Tue Dec 16 09:15:28 EST 2014
On 16 Dec 2014, at 14:32, thfl at me.com 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
[thfl at me.com]-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
[thfl at me.com].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
[thfl at me.com]
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
[thfl at me.com].eml
I hope this helps and thanks for trying out MailMate.
--
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20141216/1fe3791b/attachment.html>
More information about the mailmate
mailing list