Idea: Expand/Collapse actions in the KM Editor


  • My macros are growing in size.
  • The actions in my conditionals and loops are multiplying.
  • I am increasingly using groups to capture the structure of my macros.
  • Macro expand/collapse has become more important to me so I can focus on one part of what am developing without seeing an overwhelming amount of detail from other parts.

Technical Background

Disclosure symbols have been used from nearly the beginning of the GUI era to control levels of expansion in hierarchical structures. It is a pleasant treat that KM compound actions support expand/collapse.

As a sometime GUI designer/developer and critical GUI user, it bothers me no end when long lists of check boxes don’t give you a way to check or uncheck all and force you to tediously check/uncheck each individual item. Disclosure hierarchies don’t cause so much of a problem, but as the Finder demonstrates having an Expand All / Collapse All capability is very useful. (I could go on and on about the ways applications do or do not handle their hierarchical structures — it’s one of my favorite topics — but I think I’ve written enough to get my point across.)


So. I am wondering if it would make sense, and if it would, how hard it would be to implement, to have option + click on the arrow of a compound action fully collapse or expand all of the actions it encompasses.

1 Like

Well, there's a menu item that expands/collapses all selected actions. It's under the View menu,

This next is not an answer to your question, but in case you haven't gotten this macro, you should:

Sometimes, where the group gets inserted one action below where you want it, but just drag it up. And don't be impatient when you run it - give it a second or two to finish (I have to remind myself of this).

The point in this is that, obviously it's easier to collapse the group than a bunch of actions.

1 Like

Dan, I haven't see that. If you run across a repeatable case, please let me know so I can test and fix.

I will. I just figured it couldn’t be helped. Typical user, huh?

I’ll let you know.

not recursive — collapse a macro, expand it, and whatever had been expanded is still expanded

Surround all actions in a group. Then you can expand.collapse it at will.

That’s all I got. :slight_smile:

Still not it. Some of the macros in the group might be expanded to some arbitrary level, and I want to roll them all up to their top level. Then, when I redisclose the group, they should stay at their top level. On the other side of this, I do want to be able to open the group and everything under it, turtles all the way down.

1 Like

Well, I could write something that would work, but I’m not sure it would be great.

Here’s how it would work:

  1. All the actions would get selected
  2. Copy them all to the clipboard.
  3. Using JXA, change all the “Disclosed” properties to true/false. (I think that’s the name - it doesn’t matter, it only matters that there is, in fact, a property for this.)
  4. Delete the selected actions.
  5. Paste the result back in.

Technically, steps 1 & 2 don’t need to be done, because the macro can be read from the KM Macros Sources file. But #4 and 5 would still be needed.

Not sure it’s worth it, though.

Option clicking on a disclosure triangle expands/collapses all the actions within the same list - so it cannot expand/collapse the contents of an action. There is no UI method for the latter currently.

You can enter a single selected action (eg Group) with View ➤ Enter Action, and collapse all of them with Option View➤Collapse All Actions.

Whoa, I missed that. It is not intuitive, and I didn't try it. I just gave up when option-click didn't do what I wanted. If I had happened to try it on a second level compound statement I might have noticed that it was doing something surprising.

I never noticed that menu item — it seems that every third time I ask a question you magically remotely insert a menu command into my KM program that wasn't there before so you can tell me it was and I can be embarrassed. :astonished: That is just a menu command and keystroke equivalent for clicking the triangle of the currently selected action, right? And with option down it is the same as option clicking that triangle, right?

I played with this for a while and eventually I got what the model was, but it still isn't natural. Is this a design decision or a vast difference in implementation difficulty between the two approaches?

I assume what you meant is "the entire contents" not just "the comments"? I don't see any turtles here. :wink: