Script instead of a keyboard shortcut

Can a script be written to replace a keyboard shortcut used in OO? That is, we run the script instead of pressing the keyboard shortcut.

What specifically are you trying to accomplish?

Instead of using keyboard shortcuts, I prefer using the mouse. In OmniOutliner, I can run a script from the “Customize Toolbar” feature. I can also run the script using various launcher apps. Of course, all the scripts would include keyboard shortcuts.

Can you provide an example?

In OO, to set the “focus” I press Shift + Command + F.
But instead of that, I am writing a JavaScript script that includes triggering these keys.
I install the script in “Customize Toolbar” in OO. Now, instead of pressing the keyboard shortcut, I click on my added element in “Customize Toolbar” with the mouse. Is this possible?
Furthermore, is it possible to use “Keyboard Maestro”, which also has shortcuts as event triggers, and do something similar?

I think you would find it more straightforward if you approached it from the other direction.

Try writing a script that focuses or hoists the selection and then install that. Then you should have a button you can click and you still have the option to use shift-command-f to focus on the selection.

I’m not familiar with javascript but in applescript, you can hoist the selection with a single line:

tell application "OmniOutliner" to hoist selected rows

If you write the javascript equivalent, then you should be able to install it in the document toolbar.

You might consider looking at either of these links below for some specific ideas. You could also contact omni’s support directly using Help > Contact Omni.

Automation > OmniOutliner forum

Also, as I understand it, yes you could use keyboard maestro for such a purpose.