Use KM to Automate BBEdit Menu Steps

I am attempting to set up create a macro that would automate the process of cleaning up a block of text as I import it into BBEdit.

I have successfully created a macro that selects the Text Menu in BBEdit to:

  1. Straighten Quotes
  2. Strip Trailing Whitespace
  3. Normalize Line Endings.

These steps are easy.

However, I cannot get KM to complete the following step:

  1. BBEdit Master Menu: Select "Text"
  2. BBEdit Text Menu: Select "Canonize"

"Canonize" performs changes on a document using a list of transformations from a file, which in my case is named, "~/Documents/BBEdit/BBEdit-Canonize-Bible-Misc.txt". The sub-menu says, "Use transformations from file:" and shows a windows containing a highlighted link to the following file: "~/Documents/BBEdit/BBEdit-Canonize-Bible-Misc.txt". The "Apply" Button is also highlighted in Blue, meaning that if I performed this step manually, hitting "Apply" would run the canonization process.

KM stops processing the macro at this point. If I highlight this specific step in the macro, right click and choose "Try Action," it executes properly. However, my question is "How can I get KM to perform this step automatically?"

image

Thanks in advance!
Mark

BBEdit Verse Import.kmmacros (5.4 KB)

Macro Image

image

Hey Mark

Didn't you solve this already using a BBEdit Text-Factory?

In any case – here's an adjusted version of your macro (be sure to change the Canon file path to the correct file).


Download: BBEdit Verse Import.ccs v1.00.kmmacros (14 KB)

Macro-Image

Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 10.14.6
  • Keyboard Maestro v10.2

Note – if I was doing this I'd use AppleScript instead of a Text-Factory.

It tends to be a bit faster and is more flexible. (Of course you have know enough AppleScript to be able to use it.)

-Chris

Dear Chris,

Yes, I did solve this problem inside BBEdit using Text Factory (based upon suggestions from the BBEdit forum). However, thank you so much for showing me how it process can be completed using Keyboard Maestro. I have been studying David Sparks' KM Field Guide, and have been using KM to automate how I set up my MacBook for my daily workflow. KM is so powerful, I KNEW that there had to be a solution to the issue that had stumped me. I really appreciate your guidance and assistance.

Yours,

Mark

1 Like