Keyboard Maestro 5 contains several new conditional actions. The "Pause Until Conditions Met" actions is modest sounding but contains a lot of power. Fundamentally, the action will pause the currently running macro and watch for a specific condition to be met. What condition? Well, pretty much anything.
I'm sure there are some very interesting ways to use this, but here's a somewhat boring yet powerful macro for entering a footnote in Markdown on BBEdit.
As mentioned previously, I have a love-hate relationship with AppleScript.1 It’s an insanely bad language for the importance it has garnered on my system. But sometimes it’s all I’ve got. In this case, I wanted a pop-up menu of all of my end references in the current BBEdit document. I took it a bit further and ended up with something that I truly like.
:::applescript try tell application "BBEdit" set results to find "^\\[.
Do you want a script to quickly change the language of the current document in BBEdit?[1] Here you go:
tell application "BBEdit" set source language of front text document to "Markdown" end tell
I have several languages triggered by the same keyboard shortcut (ctrl-shift-L) using Keyboard Maestro. The group is only available while in BBEdit so there’s no need to include an “activate” command. Since they all use the same shortcut, I actually get a quick list to choose from.
Occasionally I just want to make a quick note in NVAlt/Simplenote/Dropbox[1]. Of course, I can command tab to NVAlt and create a new note in relatively few clicks. But I’m using BBEdit more and more. If I want to create a quick note from BBEdit it’s not so quick. Here’s a modification of a script from John Gruber that creates a new note in my NVAlt Dropbox folder and opens it in BBEdit.
You have to love an application with a secret preference like this:
“If you want to amaze and impress your friends and family with just how fast BBEdit’s Replace All is, there’s an expert preference for that:
defaults write com.barebones.bbedit ReplaceAllResultsIncludeTiming -bool YES When turned on, the sheet (or growl notification) will display the amount of time required for the Replace All operation.”
I’m getting more comfortable with BBEdit. It’s a huge application with too many features to wrap my head around in one sitting. I’m taking it slow. I mostly use it for long-form writing, like the recent post “Developers, A Love Story”. Each writing session I try to explore something new and see how it can help me. I’ll periodically post things that I find useful or interesting. Today’s is about Markers.
I've been slow on posting tweaks and hacks lately because I've been getting acquainted with Regex and BBEdit. Here's a good approximation of what it's like for me to write regex expressions:
I'm trying to translate Sun Tzu's "The Art of War" into Swahili with a reference library of Chinese restaurant menus.
Fortunately, some menus are better than others. Occasionally, I end up with a regular expression that I have no memory of creating and no understanding of why it works.
Good timing on yesterday's post.New version of BBEdit (10.1.1) out today.
By way of Dan Benjamin's Big Week
Continuing the riff on BBEdit, here's a script that uses the grep match for a single word. It's an AppleScript that I bound to the shift-cmd-right arrow combo. If there is no word selected, it selects the closest next word. If there is a word already selected, it selects the next whole word. It's a take on John Gruber's original Select+Word script with the additional benefit of being able to walk the selection down a line one word at a time.
There are plenty of good reasons to be eagerly awaiting a stable release of Textmate 2 but there are also equally valid reasons to avoid it. I’ve used both but I’ve never been an expert at either. I’ve used them for small personal projects but nothing that would exercise all of the features. For web development, I use Coda, for python scripts, I use BBEdit and now CodeRunner. Most of my writing for this site is done between Simplenote, NVAlt and MultiMarkdown Composer.