On Wed, Jun 28, 2023 at 8:26 PM Thomas Passin <[email protected]> wrote:
> I think you want the method g.getScript(). Look at its docstring in > LeoPyRef.leo to see how to use it. Super useful function! It works! You save my day, Thomas! I finally don't have to use my crappy, buggy recursive expansion functions that I wrote myself... > > BTW, here is how I found it. I remembered that Leo scripts get run by > writing a file called *ScriptFile.py*. So I searched for that using the > Nav tab. The first thing that came up was in *executeScriptHelper*, so I > looked at that hit. Its parent is the command *execute-script*. That > seemed promising. Looking in *execute-script* , I noticed a line script > = g.getScript(c, p or c.p, useSelectedText=useSelectedText). So I > searched for *getScript,* and that seems to be what you want. > > This is typically how I find relevant code in Leo's code base. Others > probably have their own ways, and mine is probably not the most "efficient" > way to go about it. The Nav tab makes it feasible and convenient. It's a > brilliant feature. The plugin's docstring says it was created by Ville M. > Vainio, and I applaud him for it. > Thanks for your detailed way. Maybe I need to take the time to get a general idea of what all these functions are doing... -- -- Sincerely, HaveF -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CA%2BUQrQytv-FSjkCehTVxyhR09jJPBpWzMN4gqymo1PV%2BF6fKpg%40mail.gmail.com.
