thanks for your help. i ' ll try it later. 在2023年11月23日星期四 UTC+8 00:47:58<Edward K. Ream> 写道:
> On Sun, Nov 12, 2023 at 7:55 PM 翅膀 <wzy...@gmail.com> wrote: > >> i create a @button node , and write some python script. for example >> >> ``` >> n = c.find_h("some_node")[0] >> open("xxx.md","wb").write(c.b.encode("utf-8")) >> ``` >> >> now i can click button to execute above script. >> >> But how can i config sth to automatically execute the scripte when i >> save (ctrl+s) the leo file. >> > > Good question. I've waited until now so I could give a proper answer. > > Recent revs document two new event handlers > <https://leo-editor.github.io/leo-editor/writingPlugins.html#summary-of-event-handlers> > : > > - *after-reading-external-file* > - *before-writing-external-file* > > A plugin or script could register these handlers. > > You could also use two other event handlers: > > - *save1* (before saving a .leo file) > - *save 2* (after) > > Finally, you might find these handlers useful: > > - *command1* (before executing any Leo command) > - *command2* (after) > > HTH. Please feel free to ask other questions. > > Edward > -- 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/90940585-65d5-49b5-b537-438139d34495n%40googlegroups.com.