A custom Keyboard Maestro plugin, for Sierra macOS onwards, which adds a KM Action for sending selected Mail (with hyperlinks back to Mail) to:
- A specified TaskPaper 3 project, in
- a .taskpaper file at a given filepath (TaskPaper 3 is not launched, and does not have to be running for the action to work )
Add selected Mail to TaskPaper 3 project.zip (251.5 KB)
Custom Keyboard Maestro Plug-in
© 2017 Robin Trew
- Add selected Mail to TaskPaper 3 project
Any items selected in Apple Mail are added to a named project in a specified
TaskPaper 3 file. The text format of the
TaskPaper entry is specified by a template which can contain any or all of
10 string, date and url fields.
The TaskPaper 3 application does not have to
be running, and is not launched by this Keyboard Maestro action.
The file path to the TaskPaper 3 file can
include a ~/ abbreviation of the user’s home path, and should include
the .taskpaper file extension
A checkbox enables automated creation of a new file, if no file is found
at the given path.
In the item-format text field, the field names should be given in angle
<fromName> name of sender (uses email where name string empty)
<fromEmail> email address of sender
<subject> email subject as displayed in Mail
<url> hyperlink back to the Mail item
<received> an abbreviated ISO 8601 date time string
<sent> an abbreviated ISO 8601 date time string
<now> an abbreviated ISO 8601 date time string
<box> the name of the mailbox containing the email
<toName> name of first recipient, if any (for sent mail)
<toEmail> name of first recipient, if any (for sent mail)
The ‘New messages at:’ option determines whether items will be added at the
top or the bottom of the specified TaskPaper 3 project
The plugin avoids creating duplicate entries for the same email
(by checking the urls already present in the TaskPaper 3 project)
Any Keyboard Maestro text tokens will be expanded in the File path,
Project name, and item-format fields of the plugin.
- This plugin has been so far tested on macOS Sierra, with Keyboard Maestro 8
- It uses the 700K Birch Outline library (Copyright © 2016 Jesse Grosjean) to
parse and update a TaskPaper 3 file without opening the application directly.
INSTALLATION OF CUSTOM ACTION PLUGIN
- If updating a previous version of the action, first manually remove the
previous copy from the custom actions folder at:
~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Actions
- Drag the .zip file onto the Keyboard Maestro icon in the OS X toolbar.
USE OF CUSTOM ACTION IN A KEYBOARD MAESTRO MACRO
- In macro-editing mode, click the green New Action button, select the
Third Party Plugins smart folder in the left hand panel of the Actions List
and choose the “Add selected Mail to TaskPaper 3 project”
- Adjust the settings of the custom action, choosing the file path,
project name, and TaskPaper 3 item format that you want.
- Test the macro. If notifications are enabled on your macOS system, or you
have changed ‘Display results briefly’ to ‘Display in a Window’ at the
bottom of the custom plugin, you will see a brief summary of the result.
The plugin uses the excellent Birch Outline library,
which is Copyright © 2016 Jesse Grosjean.
The Keyboard Maestro custom plugin is Copyright © 2017 Robin Trew,
and was created with the help of specifications and sponsorship provided by
Icon by Jim Krenz.