Convert to HTML Unordered List with Keyboard Maestro

In the Instant HTML List Items with Keyboard Maestro I explained my need and solu­tion for select­ing a group of para­graphs and instant­ly wrap­ping them in <li></li> list item tags. In that post I pro­vid­ed my Keyboard Maestro macro. This is a twist on that macro.

The pre­vi­ous method only wrapped the list items in <li></li>, leav­ing it to you to enclose the entire list in either an ordered (num­bered) or unordered (bul­let­ed) list with <ol></ol> or <ul></ul> tags, respec­tive­ly. Here, I’m using an even sim­pler Keyboard Maestro macro to con­vert select­ed lines or para­graphs all the way into a bul­let­ed list, com­plete with <ul></ul> out­er tags and <li></li>-wrapped list items.

How to Use It

Highlight your select­ed text and exe­cute the macro using the trig­ger you select.

Step 1 (Input)

Write and then select the lines or para­graphs of text in a text or code edi­tor. I used the fol­low­ing sim­ple lines.

one
two
three
four

Step 2 (Output)

Execute the List HTML – Bulleted Keyboard Maestro macro, which auto­mat­i­cal­ly replaces the select­ed text with a prop­er­ly for­mat­ted unordered list, com­plete 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 exceed­ing­ly sim­ple, mak­ing use of Keyboard Maestro’s built-in text fil­ters. Just recre­ate my recipe, choose a trig­ger, and get to work.

Keyboard Maestro recipe to convert text to HTML unordered bulleted list