BBEdit 10: Working around the change of behaviour for paragraph markup

Posted by Pierre Igot in: Macintosh
July 31st, 2011 • 9:54 am

I must say I am a bit disappointed by the BBEdit 10 upgrade so far. Usually, BBEdit upgrades are rather painless for me. This time, I have already, in the space of 24 hours, encountered two issues that are a significant source of annoyance for me.

The first one has to do with the revamped “Markup” menu commands and in particular with the new “Paragraph” command (under “Block Elements”). I don’t have an opinion on the interface changes yet, but I was used to applying this command (with a keyboard shortcut) to a text selection containing multiple paragraphs in order to apply opening and closing p tags to each of the paragraphs.

Well, this no longer works. Now the command applies a single pair of opening and closing p tags to the entire selection.

That might be the desirable behaviour in some quarters, but not in my neck of the woods.

Fortunately, there is an alternative, and since BBEdit is fully scriptable, I was able to create an AppleScript script and assign my usual keyboard shortcut to it instead in order to restore the functionality I was used to. The script is as follows:

tell application "BBEdit"
	activate
	translate text to html with selection only and paragraph conversion without entity conversion and create new document
end tell

It is the equivalent of using the “Translate Text to HTML” command in the “Markup” menu, under “Utilities,” with the appropriate options, i.e. without any entity conversion and with paragraph conversion and insertion of the resulting HTML code in place over the selection.


One Response to “BBEdit 10: Working around the change of behaviour for paragraph markup”

  1. Betalogue » BBEdit 10.0.1: Fixes project window issues says:

    […] I wrote in another post a couple of weeks ago, unlike previous upgrades, the BBEdit 10 upgrade has not exactly been […]