Is it conceivable to create a shortcut to ... edit a KBM macro?

hello, I have a macro which simply displays a few keyboard shortcuts that I tend to forget.
Tom kindly help me improve the text box display.
I am constantly adding more shortcuts, and modifying some already there.
Is it conceivable to create a macro which would allow me to navigate directly into the macro below, to allow me to quickly edit the text displayed.
thanks very much in advance

It is indeed. All you have to do is use this AppleScript in an Execute AppleScript action and substitute the name or UUID of your macro (preferably the UUID, since that frees you to change the macro’s name in the future without also having to change this script. You can get a macro’s UUID from the Edit menu through Copy as>Copy UUID):

tell application "Keyboard Maestro"
	activate
	editMacro "MACRO NAME OR UUID"
end tell
1 Like

Instead of storing the text inside the macro, I would make a nice RTF file with all the shortcuts.

This has the advantage that you can quickly edit the file with your preferred RTF editor, without the need to open the macro each time.

To display the contents of the RTF file in a KM window, just copy it to a named clipboard and display the clipboard with a Display Text action, like this:

[test] Display RTF in KM Window.kmmacros (2.9 KB)

  1. The first action copies the file contents of the RTF file (here “test.rtf”) to a named clipboard, here “_Tmp”
  2. The second action displays the “_Tmp” clipboard.

3 Likes

This is a good way to maintain a set of cheat sheets on different applications. If you wanted to narrow down the cheat sheets to one application or topic, you could have several instances of the macro that loads from a RTF file all together in a conflict palette – each macro instance would be dedicated to a topic and it’s related RTF file.

2 Likes

You can even do a fully modular approach, since you can display any combination of file contents in one KM Text window:

So you can combine different shortcut sets for different situations. Or you can combine shortcut subsets from different apps into one KM Text window. (It is only limited by how fine-grained the modular structure of your shortcut sheets is :wink:)

Edit:

Trying to express myself better:

You can, for example, make documents fine-grained like this:

File menu shortcuts of app A
Edit menu shortcuts of app A
View menu shortcuts of app A

File menu shortcuts of app B
Edit menu shortcuts of app B
View menu shortcuts of app B

Then, on KM level, you can decide to either display

  • all shortcuts of app A, or
  • all Edit menu shortcuts of all apps
  • etc.

in one window. (Or also in multiple windows, of course.)

2 Likes

I had this same idea, but abandoned it when I tried storing the RTF's contents in a variable and found that it failed to display properly. Now that you've shown how it can work as long as you use a clipboard, along with other ideas for more fine-grained display I can see this being very useful!

1 Like

@Tom @korm

Thank you both for your comments. I apologize for the delay.

I played around with your suggestions and have 2 comments:

1- I think that we are all familiar enough with computers to actually need only a very limited number of shortcuts displayed. Those that we tend to forget. One sheet per app, etc is simply too much in my opinion. Otherwise, it is just a make work project. If too many shortcuts are displayed we are converting a shortcut reminder into a tedious 'fishing for s shortcut within a sea of shortcuts we don’t need to remember. This is the problem with KeyCue.

2- Tom’s idea of having an editable, macro accessible file is excellent. Question is which format? I played around with different formats and the feature I found most useful (easy to edit - add and delete shortcuts-, nice display without having to scroll down) is a multi-column display similar to the multi-column format option in MS Word. I will quickly add that I find MS Word atrocious otherwise. Please note that multi-column display is extremely simple to edit and nice looking, in stark contrast to a table which is very tedious to edit, cell by cell

So the question is: is MS Word really the only option to get a multi-column display?

thanks so much to both of you for your input !

PS: I just discovered that it works with Pages. Is the solution to display a Pages file?

At the end it doesn’t matter which editor you use. I don’t know how KM’s Named Clipboards exactly work, but I guess they are copying similar to the OS clipboard. That is, as long as the document offers something to copy to the RTF clipboard type, it should be displayed more or less correctly in the KM window.

But I doubt that Rich Text with multiple columns will work here. A column layout is a rather a document attribute, whereas a table is an element, say like a paragraph. I don’t think the KM Display Text window (or even the RTF clipboard type) can correctly handle document-level RTF attributes, but I might be wrong.

But why is a table hard to edit? IMO it’s not harder to edit than a regular text with tab stops.

Since for the display most likely the RTF clipboard type is used, the most reliable way would be to produce a RTF document; most things you see in the RTF document (yes, except things like columns) should be compatible. (My preferred RTF editor is Nisus Writer Pro. Grab it immediately when you see it offered with a software bundle. I would even buy it for the full price, it’s easily worth it.)

Since recently you can also save from Pages to RTF. Or MS Word, of course, and for simple stuff TextEdit. Scrivener also writes RTF.

1 Like

thanks very much Tom.
It’s funny. I was just about to buy Nisus, and then hesitated because I use Scrivener a lot, and it seems to be an alternative to Scrivener.

  • Would there be advantages to using both Scrivener and Nisus?
  • Nisus: is the learning curve steep? How are outlines in Nisus? Very important for me. I use outlines a lot.
  • I don’t understand why your focus is on RTF (sorry !! you must be rolling your eyes!!). Why not display any document with some kind of decent formatting: RTF, Pages, MS Word, etc ?
    thanks again very much !

They are different. Nisus is a fully-fledged word processor, like for example MS Word or the word processor of the LibreOffice suite.

I can imagine, yes. As said, they are different. Nisus is very good for creating self-contained documents for print or PDF, Scrivener is more like a project/resources manager with integrated typesetting capabilities, no? (I’m not using Scrivener a lot, I bought it out of curiosity.)

Not much, I would say. It has a very Mac-like GUI, even a bit old fashioned, if you want so. Compared with MS Word it is marvelous: UI elements are there where you expect them, they are structured/organized in a logical way, and they do the things you expect them to do. Let’s say, the complete opposite of MS Word :wink:

You find a very short review of Nisus on my blog.

No, I just said that probably the most reliable way (in terms of getting the same appearance) would be to have a RTF document.

The thing is the macOS clipboard, as I tried to explain in my post above:

The clipboard is not a single chunk of data, it has various flavors, aka clipboard types. Example:

If you copy text from a MS Word document you’ll find the copied data on the clipboard as…

  • RTF
  • HTML
  • Plain text
  • and many more clipboard types

My assumption is that KM’s Named Clipboards work similar to the OS clipboard. That means (if my assumption is true): if you read a file to a Named Clipboard it’s similar to selecting all and copying it to the OS clipboard.

Now the important stuff:

  • It depends on the source which clipboard types will be populated when copying. If you copy a JPEG image you won’t find any data on the RTF clipboard type, nor on the HTML type.

  • When pasting from the clipboard, it’s the target app that decides which clipboard type to choose.

Since KM’s Display Text action will most likely prefer the RTF clipboard (if not available it will take the Plain Text) we should assure that there is something good on the RTF clipboard type. And the best way to do this is certainly to have a fully RTF-compatible format, speak an RTF document.

As said, this is not necessary, since also non-RTF documents will allow the clipboard to take RTF data. But the chance to loose formatting is higher in that case. Just copy from an Excel document and paste into a RTF document (or a KM Display Text action): some formatting will be maintained, other things will be messed up.

So, my proposal to save as RTF was only to optimize chances to get the KM window to display the same as you see in the source document.

1 Like

fantastic reply. I am getting Nisus tonight. Thank you so much !!

I couldn't agree more. That's why I have the same shortcut configured for each application where I want to use macros -- a shortcut that is limited to that application and invokes a macro palette (including the macro for that app's cheater file) specific to that application. IOW -- the shortcut I use -- control-\ -- will invoke a palette in Safari, and a different palette in Mail, and a different palette in DEVONthink, and so on.

I can barely remember that ⌘Q quits every app :laughing: But at least I can remember that the macros for this app are invoked with control-\

1 Like

vielen Dank !

I’ve just seen, if you download it you have 15 days free trial.

Yes, as others have shown you.

You can also achieve this without creating another macro. Both the native KM macro/action "Trigger by Name", and the @DanThomas macro Execute Macro by Name (Spotlight) allow you to edit the macro you have found.

I agree with @Tom.

For me, I would use an Evernote Note which support RTF, including tables.
The advantage is that it can be displayed (triggered) in a variety of means:

  • KM Action Open URL, using either the internal or web-based URL of the Note
  • Spotlight search
  • Evernote search
  • LaunchBar search

You could also share the EN Note as a Public Note (read only) that would allow anyone with the Public URL to view the Note in a browser.

2 Likes

I think @JMichaelTX is pointing in the right direction: There are many ways to quickly display some cheat sheets, and KM is not necessarily the best one.

Here a very simplistic approach:

‌1. Create your sheets with whatever app you prefer
‌2. Put them into a folder “Shortcuts”:

‌3. Drag the folder to the Dock:


Now you have a couple of ways to quickly display the content:

A. With the mouse:

  1. Click the “Shortcuts” folder in the Dock
  • It will open up to a grid
  1. Hover with the mouse over the desired sheet
  2. Hit the spacebar to invoke QuickLook

B. With the keyboard

  1. Navigate to the “Shortcuts” folder (or to a specific sheet) in LaunchBar
  • This will take not more than two keystrokes (e.g. “SC”)
  1. Still in LB, hit the Spacebar on a sheet to invoke Quicklook

1 Like

@Tom
Thanks very much Tom.
I don't think that the multi-file approach is the solution from my perspective.
I bought Nisus Pro and am extremely happy thanks to you. I am very grateful.****
I found the ideal (for me) solution: Nisus with column display (Window➡️ Palette➡️ columns) and RTF format, following your suggestions above.
If you don't mind I have a question on how to configure a macro with Nisus.
My german is intermediate to advanced. I read a rather difficult german newspaper article every day, decipher the difficult idioms and expressions, make notes in a word processor and walk around with the printout in my pocket all day.
I am now going to use Nisus as the word processor.
There are 2 situations:
1- I find a difficult word which I want to look up the in dictionary, in which case I highlight the word (double tap), right click, and choose lookup
2- the second situation is that I am dealing with a more difficult word not in the dictionary or a multi word expression in which case I have highlight multiple words, then right click, go to the services menu and choose Linguee
I was wondering if you could orient me as to the best approach to do the above quickly, because in any one text, I can do it more than 30 times.
thanks very much !

——————————————————————

Happy to hear :relieved:

What about using the global shortcut, which usually is ⌃⌘D

(If you used KeyCue you would have known that :wink:)

You can assign shortcuts to your services in System Preferences > Keyboard > Shortcuts > Services

When it comes to proper Nisus macros you should start with the Nisus forum. There is a dedicated subcategory for macros.

1 Like

thanks very much for your multiple answers.

By macro I meant KBM. I should have been more clear in my question.

One last point: when I drag and drop a Nisus created document into Scrivener , I don't get the option (like I would with pdf, pages, etc) to open in an external editor with the icons below at the bottom.

Do you know if it's possible to change the default Scrivener RTF editor to Nisus or in some way tell Scrivener 'this is a Nisus RTF document, please edit in Nisus'?

thanks !!

The easiest way:

Save your documents as “Nisus Compressed Rich Text”:

These files have the a “zrtf” extension. Basically they are just zipped RTF files, but with some other optimizations (for example identical images in the document don’t produce double image data, IIRC).

The zrtf extension should be associated with the Nisus app by default. I use this format for documents which shouldn’t be edited with another program (e.g. MS Word, since both programs have slightly different interpretations of the RTF format).

You can re-save it as “rtf” at any time and without any loss, in case you change your mind.

1 Like