Convert to HTML Unordered List with Keyboard Maestro

In the Instant HTML List Items with Keyboard Maestro I explained my need and solution for selecting a group of paragraphs and instantly wrapping them in <li></li> list item tags. In that post I provided my Keyboard Maestro macro. This is a twist on that macro.

The previous method only wrapped the list items in <li></li>, leaving it to you to enclose the entire list in either an ordered (numbered) or unordered (bulleted) list with <ol></ol> or <ul></ul> tags, respectively. Here, I’m using an even simpler Keyboard Maestro macro to convert selected lines or paragraphs all the way into a bulleted list, complete with <ul></ul> outer tags and <li></li>-wrapped list items.

How to Use It

Highlight your selected text and execute the macro using the trigger you select.

Step 1 (Input)

Write and then select the lines or paragraphs of text in a text or code editor. I used the following simple lines.

one
two
three
four

Step 2 (Output)

Execute the List HTML – Bulleted Keyboard Maestro macro, which automatically replaces the selected text with a properly formatted unordered list, complete with code-indented list items. My result looked like the following.

<ul>
    <li>one</li>
    <li>two</li>
    <li>three</li>
    <li>four</li>
</ul>

The Keyboard Maestro Recipe

The macro recipe itself is exceedingly simple, making use of Keyboard Maestro’s built-in text filters. Just recreate my recipe, choose a trigger, and get to work.

Keyboard Maestro recipe to convert text to HTML unordered bulleted list