Is there a way to swap the Enter key and Opt - Enter key combination in Numbers using a KM macro?

Ventura 13.6.7, KBM10.2
In Numbers, if I am editing text inside a cell and press the Enter key, I navigate to a cell in the next row below. I need to press Opt-Enter to trigger a new line within the cell I am editing
Like many people (according to my google search), I am constantly mistakingly pressing Enter instead of Opt - Enter to go to a new line.
I was wondering if there was a way to swap so that Enter triggers a new line and Opt-Enter to navigate to the next row below.
thank you very much

I have the same problem as you. I might like a solution to this, also.

I think you could create a "macro group" called "Numbers" which is configured so that it runs only when Numbers is the active application. Then that macro group would contain two macros. The first one would use a hotkey to trigger when you press ENTER and send OPT-ENTER to the app, and the second one would do the reverse.

Here's what one of the two macro would look like. With this information, are you able to create the macro group and the two macros? Let me know if it works.

1 Like

very interesting. I will give it a try and give you a follow-up. thanks very much !

works perfectly. thanks again !

To edit text in a cell, one has to double click on the cell which becomes tedious. Have you found a quicker way to do so ? Could KM once again be useful ? thank you

Let me think about that.

But you aren't entirely correct, because the first click when you double click is just to select the cell, while the second click is to edit it. But let me think about it.

1 Like

yes, you are right.

No need for KM for that one; Control-Equal will edit the currently highlighted cell.


It's tricky. I think I'm onto a solution.

The solution might be more reliable if you have a programmable mouse that allows you to redefine the primary mouse button, so I need to ask if you have such a mouse. But even if not, I may have a solution. Since it involves a small amount of AppleScript, it could take me hours to figure this out. And right now I have to go run an errand. (I have a Plan B in case AppleScript doesn't work out, but again, reliability might be an issue.)

Control-Equal is "slower" than a click because that's two coordinated presses, while a click is a single press of a button. Moreover, he wanted LESS than a single click. And to my amazement, I just found a way to do it. I had to borrow some Javascript for Automation and pull some other techniques out of my hat, but I did it. I will add the code to this thread in a moment...

Okay, here it is. This code will poll the current cell (five times per second) that you are located in, and if you change your cell with the mouse, and if your change is not a "range", it will automatically send OPTION-ENTER to Numbers to automatically "edit" the cell.

I'm surprised I got this to work. However there's a 75% chance this macro might have side effects that I cannot predict. I'll leave it to @ronald to test it out and see if it's usable, or if it's garbage. In any case, it was a fun challenge. If he finds any bugs, there's a chance I can fix them.

Numbers Selected Range detection with Javascript Macro (v11.0.3)

Numbers Selected Range detection with Javascript.kmmacros (11 KB)

1 Like

This is where we disagree: Anything I can do on the keyboard is automatically faster than reaching for a mouse. But that’s a very creative solution!


1 Like

Thanks for the compliment. But I'm puzzled by your position here. In order for CTRL-EQUAL to work, you have to first select the cell. In my solution, no matter how you select the cell, the cell is automatically opened with ZERO keystrokes or clicks. Zero effort is always lower effort than anything, including CTRL-EQUAL.

1 Like

thank you very much @Airy for the macro. I have a trackpad.

2 birds with one stone

@Airy @griffman :
I realized that the macro written by @Airy to swap ↵ and ⌥ ↵ also solves the problem of the double click to edit a cell. Just select a cell and press ↵