I’ve always wanted the ability to toggle the "soft wrap" and "show invisibles" features of BBEdit with keyboard shortcuts. I could never understand why this feature wasn’t added to the product after fourteen significant releases. BBEdit does provide the ability to ad keyboard shortcuts to any script, filter or menu item, but the things I need kb shortcuts for aren’t standard menu items, they’re editor window menu items.

While working with the projects in Eric Meyer on CSS I couldn’t take it anymore. I needed these keyboard shortcuts. So I scoured the manual, Googled and Googled and figured the only way to get what I need was with Applescripts. I’ve tried this before unsuccessfully, but I was not going to be stopped this time. My new Applescripts were not working as I wanted so Googled again and landed on this AppleScripts for BBEdit page. The two scripts I needed were on this page, but they were written for BBEdit 6 in Mac OS 8.5, would they work with version 7, on OS X? Yes, Editing the scripts slightly was all that was needed to allow them run in BBEdit 7 on OS X. Now all I needed to do was pick a few keyboard shortcuts and assign them to these scripts. I selected command-option-i for "show invisibles" (I was already using this shortcut in Adobe Illustrator) and command- for "soft wrap" (seemed logical enough since command-option- is built into BBEdit as Hard Wrap).

It turns out that I needed one more script. BBEdit considers spaces a separate case of invisible. So I needed to toggle "show spaces" as well. A quick trip to script editor was all that was needed. I assigned command-option-control-i to this script and I was in business. Matthias Steffens, the author of the original scripts does not indicate if derivative work can be distributed, I’m guessing that he won’t mind (since I’ve attributed the original work to him), so I’ve made the three new scripts available for download here.
0 Response to “BBEdit Applescripts to the rescue”