I think you want the method g.getScript().  Look at its docstring in 
LeoPyRef.leo to see how to use it.

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.
On Wednesday, June 28, 2023 at 1:29:23 AM UTC-4 iamap...@gmail.com wrote:

> Hi, Leo user,
>
> Who knows how to get all the contents of the body?
> What I want is to replace << xxx >> and @others in the body.
>
> I have created a simple function, but it has problems handling child nodes 
> or children of child nodes. I suspect there is a ready-made function, but I 
> can't find it anyway, can anyone tell me about it?
>
> Thanks!
>
> Best,
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/5167ebfd-2cb3-4ab3-b23e-c7bc98bd8d9an%40googlegroups.com.

Reply via email to