Inspired a bit by MacOS X Guru's use of TaskPaper and its command palette, I thought I'd add an extension to PopClip for the Tinderbox menu command "Make Web Link."

In my case, I had previously created a keyboard shortcut for Make Web Link, control-option-command-L. That works, but as it happened I seldom used it. Since I must highlight the anchor text in the $Text of the post, PopClip appears automagically anyway, so I read about how to create extensions to PopClip (link above), and figured I'd give it a try.

It worked. Very nicely! It's at the end of the choices, so I'll want to look at how to move it to the front, but so far, so good.

Now, a brief Tinderbox digression. In the paragraph at the bottom, I wanted to include the text of the PopClip extension. PopClip uses YAML to parse extensions (I have no idea what any of that means), and # is used to denote a comment (Ignore it for processing purposes, although "ignore" is a process.) But Tinderbox uses a few characters like #, and * to create Quick Lists. So if I use # at the beginning of a line of YAML, it exports from Tinderbox as the numeral "1." as the first element of an ordered list.

At first, I thought I could change the text font to Code, which would essentially "escape" all the text from HTML export processing. Wrong!

The last line of the immediately preceding link is,

If you want to use $HTMLMarkupText but have paragraphs starting with *, # or • you can just set $AutomaticIndent to false. This essentially suppresses Quick List functionality.

So I went to Displayed Attributes and added $AutomatiIndent and set it to false. Checked Preview in this post, and there was the numeral 1 again. Still. Whatever.

So, more prowling around in aTbRef, where I found this discussion.

The relevant line there being:

If the $HTMLListItemStart and $HTMLListItemEnd attributes are empty, all quick lists, as defined by lines starting with an * or a #, are disabled and content is exported verbatim (i.e. including the * or # markers).

So that's what I did in the "LIst" pane of the "HTML" pane of the Inspector window. This had the desired effect, and the # appears below at the start of the extension.


That same page also includes this, which would have been helpful right from the start:

To stop a quick list character at the start of a line from being interpreted as quick list markup, either:

Place an Option+space character at the start of the line.

Use the HTML encoded symbol for that character, e.g. replace '#' with '#', or '*' with '*' etc.

Nevertheless, why didn't turning off $AutomaticIndent work? Searching for the attribute $AutomaticIndent takes you to this page, with a red(ish) (salmon?) banner at the top that says $AutomaticIndent is deprecated. Which suggests that the line in the Exporting Code Samples entry I linked to above (See: "Wrong!") should be deleted.

There are five (six, now) links in this post, and I used the PopClip extension on each of them, and it worked flawlessly ever time. I could probably add a "pause" and Return key press and have the whole process automated. Maybe later. Here's the link for PopClip if you're interested. I use it a lot.

The text of the extension is this:

#popclip Tinderbox make web link

name: Make Web Link

icon: # Apple SF Symbols

key combo: control command option L

✍️ Reply by email

Originally posted at Nice Marmot 06:42 Sunday, 7 April 2024