I tend to use c.executeMinibufferCommand('name-of-command') -- doesn't need any extra parameters, and Just Works TM.
Jake On Sun, Sep 3, 2023 at 8:41 PM Félix <felixgra...@gmail.com> wrote: > Making script in Leo is great, with the globally defined vars g, c and p > anything is possible. > > But what is the recommended way of doing a simple command by name in a > script? > > The *c.doCommandByName* method exists, but it insists on having an event > as a second parameter. > > I discovered that I can make it work by passing a fake event such as : > {"c": c}, or even a better one: g.app.gui.create_key_event(c), but this is > quite unintuitive. Could it not default to a valid default event if the > event is not passed? > > Félix > > -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to leo-editor+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/leo-editor/68b44f92-c2fd-403b-97aa-58fba041d366n%40googlegroups.com > <https://groups.google.com/d/msgid/leo-editor/68b44f92-c2fd-403b-97aa-58fba041d366n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAJ1i%2BSYT-AFXw7B1OnnrJc2NHBAH-HF0UgVrqXhbTq6%2Bej9wig%40mail.gmail.com.