Is there a keyboard shortcut to page to the top of a macro being edited?

I'm talking about the edit macro column on the right. I know I can use PgUp and PgDown to scroll a "page" at a time, but is there a keystroke that scrolls to the top? I would have thought Cmd-PgUp, or something like that would work, but it doesn't seem to work.

Any ideas?

I think of cmd+up arrow as the general Mac shortcut for this movement (but I am not by my Mac at the moment so I cannot test if it works in the KM Editor or not)

Thanks. That doesn't seem to work for me, but I might have remapped that keystroke somewhere, so I'll have to look around.

Can anyone else verify this should work? Thanks,

Home and End seem to work as expected here.

-rob.

Command-Up Arrow and Command-Down Arrow also work, but only if you're not in a text field in the macro. (The same applies to Home and End, obviously, as then all those keystrokes go to the text field.)

-rob.

Thanks, guys. Can you try this:

  1. Obviously, start with a macro that is long enough to have scroll bars. Preferably multiple "pages" of scrolling.
  2. Scroll down to the bottom.
  3. Click on the macro in the Macros column.
  4. Press Tab. (This will put you in the Macro Icon image well, but you won't see that yet.)
  5. Does your keyboard shortcut take you to the very top so you can see the Macro Icon image well?

Ultimately, what I'm trying to do is put focus in the Macro Icon image well, and have it not be scrolled off the visible page.

My answers would have been different had you asked that originally :). In my testing, it seems the icon well acts like an input box of some sort, because it traps almost all the keystrokes except Page Up and Page Down.

I can't think of any way to do what you want to do, even using things like Tab to get off the image well and back to it don't work. Tabbing forward works, until you Tab into the trigger box and change the trigger to Tab :). Tabbing backwards doesn't work because that selects the macro column again.

-rob.

Thanks, Rob, and excellent points.

For now, I'll settle with repeating PgUp a bunch of times. It's not mission-critical that the icon is visible, it would just be nice.

I actually had some AS code that could manipulate the scroll bar, but it doesn't work anymore and I have no idea how to fix it. UI manipulation is fragile anyway (to say the least).

I have Keyboard Maestro 11.0.3 installed on three macs and the macOS native shortcut keys ⌘↑ and ⌘↓ (and Home/End) work on all three:

  • Sequoia 15.0 (24A335)/MacBookPro18,2
  • Mojave 10.14.16/Macmini6,2
  • High Sierra 10.13.6/iMac11,1445

@DanThomas, if the native shortcut keys don't work for you, I suspect you could use this simple macro:

Download: Select First or Last Action of Current Macro.kmmacros (4.9 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 15.0 (24A335)
  • Keyboard Maestro v11.0.3

1 Like

Odd. I don't know why it doesn't work on mine. But it's OK.

I may try your AS script. It might be the best solution for me. Thanks!

Jim, did you try those keys when the icon for the macro was selected, as in Dan's instructions above? In that case, on both my Macs, only Page Up and Page Down work.

-rob.

I just tried ⌘↑ and ⌘↓. When the macro icon is selected, I hear a beep, but no scrolling occurs. However, the macro I shared above does function as expected.


Nope; when moving up with ⌘↑ or with the macro I shared above the editor scrolls the minimum amount required to show the bottom of the first action. Some manual scrolling up is required to see the macro icon.

2 Likes

@DanThomas, I've often wanted this myself, so I took on the challenge and created and shared this: Scroll to Top or Bottom of Macro

1 Like

Another way to get to the absolute top of a macro is by pressing Command-Option-L, the shortcut for renaming a macro (View -> Rename...).

In that case, Command-Option-L followed by Shift-Tab would have the Macro Icon image selected. I trust it goes without saying a macro could duplicate these steps.

5 Likes

Oooh - this one's great! Thanks.

1 Like

Thanks, @NaOH! If I even knew that keyboard shortcut, I had forgotten. :face_with_open_eyes_and_hand_over_mouth:

I've updated Scroll to Top or Bottom of Macro applying the method you suggested.

Sort of an orthogonal answer based on my interpretation of what you need, so i may be way off, but i use groups to collapse huge sections of code.

This makes editing, testing, and maintenance simpler.

1 Like

Posted in the other thread about this, an AppleScript to scroll to the top (or bottom) of a macro.

I agree 100%. I use groups in groups, with colors and all sorts of things. Very useful.

My original post was because I'm automating some things in the editor, and was looking for an automated way of getting to the top.

But I totally agree about groups - they're awesome!