An Action for the LaunchBar application (macOS).
What it does
This is an example text to demonstrate how Markdown^[This is an inline footnote] is converted to plain text: An unordered list: ================= - a list item - another list item with a some more text to show how list items are hard-wrapped and indented (in this case with 4 spaces and to a max. length of 72 chars) - and a last list item with a subitem: - subitem[^myFnote] [^myFnote]: Also referenced footnotes can be used. # An ordered list: 1. This is the __first__ point of an ordered list 1. Footnotes are useful to get longish links^[https://en.wikipedia.org/wiki/Hyperlink#Hyperlinks_in_various_technologies] out of the text body 1. …but the usual Markdown [link syntax](https://daringfireball.net/projects/markdown/syntax#link) will also be referenced at the end of the text. A table in-between: | Tables | Are | Cool | |--|:--:|--:| | col 1 is | left-aligned | $1600 | | col 2 is | centered | $12 | | col 3 is | right-aligned | $1 | 4. To continue a list numbering 4. just start with the desired number End of text. ***
Output (plain text):
This is an example text to demonstrate how Markdown is converted to plain text: AN UNORDERED LIST: - a list item - another list item with a some more text to show how list items are hard-wrapped and indented (in this case with 4 spaces and to a max. length of 72 chars) - and a last list item with a subitem: - subitem AN ORDERED LIST: 1. This is the FIRST point of an ordered list 2. Footnotes are useful to get longish links out of the text body 3. …but the usual Markdown [link syntax] will also be referenced at the end of the text. A table in-between: Tables Are Cool ---------- --------------- ------- col 1 is left-aligned $1600 col 2 is centered $12 col 3 is right-aligned $1 4. To continue a list numbering 5. just start with the desired number End of text. ------------------------------------------------------------------------  This is an inline footnote  Also referenced footnotes can be used.  https://en.wikipedia.org/wiki/Hyperlink#Hyperlinks_in_various_technologies [link syntax]: https://daringfireball.net/projects/markdown/syntax#link
How to use
- In your text editor, select the Markdown text that should be converted.
- Send it to LaunchBar with your Instant Send key
- Select the action by typing the appropriate abbreviation (for example
- Press Return.
- Once the result appears in the LaunchBar window press ⌘C to copy it to the clipboard.
- Paste it wherever you want.
As you might know, LaunchBar allows you to directly insert string results by pressing Shift-Return. So, if you prefer to replace the current text selection with the result (instead of copying it to the clipboard), then just press Shift-Return in step 4.
If you want to send the result to another action, then press the Tab key as soon as the result appears in the LaunchBar window, and then invoke the other action.
How it works
- The action uses a Perl script.
- The conversion is done by Pandoc.
- After the conversion the script appends a Tab character to the end of each line that is not followed by an empty line. This should prevent certain broken email clients (namely Outlook) from arbitrarily removing line breaks.1 You can deactivate this in the script (see the comments there), if you don’t use Outlook or if you don’t send plain text mails to Outlook users.
- LaunchBar, of course.
- Pandoc; can conveniently be installed via Homebrew:
brew install pandoc
If you don’t want to install it, then download the standalone Action, which contains the Pandoc binary (~20MB; see Download section blow).
- Perl (preinstalled with macOS).
- I have included the required Perl modules
JSONin the Action bundle.2
Pandoc is highly customizable and you can tweak the output text to your needs. To do so, just edit the Pandoc options in the script. (It is the line that begins with
You can for example adjust line length, indentation of lists, enable/disable “smart” replacement, footnotes location and more. For the complete documentation of the options see the Pandoc user manual. Explanations for the most important options you find also at the end of the script file (
Use the excellent Action Editor to open and edit the script file.
Normal version (recommended):
Download (1.0 / 2017-04-17)
Standalone version (with Pandoc, ~20MB):
Download (1.0 / 2017-04-17)
Apple’s mail client has an annoying limitation: If you want to export mail messages as
.emlx you have to do it one by one, i.e. dragging one message at a time from the Mail App’s window to a Finder window. It won’t let you drag several messages at the same time.
However with a small script this limitation can be circumvented easily. (This is Part II of the other Mail Export post.)
I just learned about a very useful keyboard shortcut, apparently introduced with macOS Sierra:Continue reading macOS Sierra: Show Hidden Files in Finder
This is a small follow-up to my content blocker comparison from September 2015.
Quite some things have changed since then. Continue reading Safari Content Blockers for Mac and iOS
OS X comes and always came with Apple’s Mail app. And since I can think many folks are complaining about the shortcomings of this app. While I always thought this was exaggerated, I wasn’t enthusiastic about Mail either.Continue reading Back to Apple’s Mail
Jetpack is Automattic’s widely used mega plugin for standalone WordPress installations. Amongst others it brings features from wordpress.com to wordpress.org installations. Currently it comprises 36(!) modules that can individually be activated or deactivated.
You can see Jetpack either as an ample extension of WordPress, or simply as an example of pure bloat. Continue reading Alternatives to the Jetpack Plugin for WordPress
Bloom Built’s Day One for iOS and OS X was a very good and polished journaling (diary) application that I used with pleasure.Continue reading Thoughts on the New Version of ‘Day One’ (Journaling App)
With OS X El Capitan (10.11) the Finder has gained a handy new feature, called Delete Immediately… .
To immediately delete one or more files or folders select them in the Finder, then hold down the Option and Command key and press Backspace. (⌥⌘⌫) Continue reading ‘Delete Immediately…’ in OS X El Capitan