Trouble Evaluating Grep Checkbox Status in BBEdit's ‘Find’ Dialog Box

I want to assure the Grep box is checked in the Find dialog.

I've tried if-then, using "a button with the name 'Grep' is off/on, enabled/not enabled, exists/does not exist" and Keyboard Maestro seems oblivious to this dialog box. (I'm just testing by letting a sound action play for the if-then.) Also, I'm triggering with a keystroke so it's not actually focused on Keyboard Maestro.

I found the discussion at Can KM9 Focus on a Dialog Box? but I'm not sure if it applies.


Screen Shot 2021-01-01 at 09.48.02 Screen Shot 2021-01-01 at 09.58.38

By default, all of the options in the Find window can be toggled by keyboard shortcuts. The one for Grep is ⌃⌥G. You can change them in BBEdit's Preferences.

1 Like

Thanks for the reply! The toggling shortcut is great, but how do I know if it needs to be togged to be checked? Is there a way Keyboard Maestro can evaluate whether or not it's checked, so I'll know whether I need to toggle?

It's a little confusing that it's labelled "Use Grep" when, if it's already checked, it really means "Don't use Grep!" It would be handy if it just made sure it was checked, no matter what.

BTW, my BBEdit uses Ctrl Sh G for this, rather than Ctrl Opt G.

BBEdit is highly scriptable, including the equivalent of the Find dialog.
If you would like to provide a real-world, detailed, example of your source data, and what you'd like to find, then we can probably provide you with an example you can use.

Sorry, I was under the impression you wanted something that would click the buttons while you had the Find window open in front of you, so you'd know whether they were checked or not. Apparently, what you want is to fiddle with the nature of the Find within another automation. For that situation, @JMichaelTX has the right answer: use BBEdit's AppleScript dictionary to control the Find options.

As for the Option/Shift thing, it's likely I changed my shortcuts 100 years ago and have fooled myself into thinking they're the defaults.

Hey Russell,

BBEdit's Find dialog uses non-standard controls, so Keyboard Maestro can't see most of them.

Even AppleScript UI-Scripting with System Events can't see them.

So your only option is to use a Found Image action.

I've fussed to Rich about the Find dialog for years...

I want direct access via AppleScript to the Find and Replace strings – and I want to be able to get and set the status of each check-box – whether the Find window is open or not.

To me this would be enormously useful, but I seem to be a minority of one...

If you're willing please make a feature request to BBEdit support.

Bare Bones Software <>


1 Like

I rarely use BBEdit, just for occasional Grep text manipulation, so the free version does what I want. I got the idea to use Keyboard Maestro to simulate the paid version's "Text Factory" tool by just scripting entry into the Find dialog in a series of macro groups. Before those groups run, I want to be sure the Grep box is checked.

Here's a screenshot of the macro template I've made, where I learned Keyboard Maestro really can't see what's going on in the Find dialog, having it play a sound if a button named "Grep" even exists. Someone suggested AppleScript might do this? Thanks!

I rephrased my earlier post a bit:

Even AppleScript UI-Scripting with System Events can't see them.


Yes, Chris, looks like Found Image is the only option. Thanks!