How to batch create palettes of simple one action (open URL) macros based on a table in Numbers exported to CSV

OK -- so, building off our previous work with Bear, here's an approach that gets the complete text of a particular Note then extracts the URL from the table row with the specified number.

It assumes that the Bear Note contains markdown table like this:

| Num | Link                                                         |
|-----|--------------------------------------------------------------|
| 1   | [The BBC](https://www.bbc.co.uk)                             |
| 992 | [KM Forum](https://forum.keyboardmaestro.com/latest)         |
| 13  | [KM Manual](https://wiki.keyboardmaestro.com/manual/Single_Page_Version) |

...though it would be easy enough to change the regex if your link entries are different.

In both versions of the macro you'll need to set the value of Local_noteID to the "Identifier" (UUID) of your Bear Note. And check that Local_dbPath is correct for your Bear database. As written they pop a "Display Text" showing the URL.

This one uses a "Prompt for User Input" so you can see the number you are entering:

Find and Open URL (dialog).kmmacros (8.3 KB)

Image

This pair of macros does away with the dialog. The first is just an "activator" for the second, with a hot key of ⌃⌥⇧⌘U:

Activate Find.kmmacros (1.5 KB)

Image

...while this is the meat -- once activated it will swallow and store a sequence of typed numbers, until you hit Return to go find the URL or ESC to cancel the process:

Find and Open URL (no dialog).kmmacros (10.8 KB)

Image

Upside -- no annoying Prompt :wink:
Downside -- you can't see the number you are entering :frowning:

As usual for me, little or no error checking -- you'll probably want to at least cater for the regex not finding a match since, as it stands, you'll have to go and clear the Global_selectedNumber yourself...

3 Likes