Dear Israel,

There are plenty of ways to do it in LEO but this is how I do it.

Create a @button node with script, select text in body, and run:

@language python

#get selected text from body
w = c.frame.body.wrapper
s = w.getSelectedText()
start,end=w.getSelectionRange()
b=p.b

#do something
s=s.replace('\n','\\\\\n')

#insert edited text back
p.b=b[:start]+s+b[end:]
c.redraw()

____________________
With Best Regards,
Luka


чт, 3 нояб. 2022 г. в 20:11, Israel Hands <[email protected]>:

> I'd like to make a script that adds Latex end of line characters  \\ to
> the end of each line in a block of body text that I have highlighted in
> Leo. I know this probably isn't complicated, but then neither am I.
>
> Thanks
>
> IH
>
> --
> 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/2fab05c1-21f9-48be-a402-90af2b21b638n%40googlegroups.com
> <https://groups.google.com/d/msgid/leo-editor/2fab05c1-21f9-48be-a402-90af2b21b638n%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAP4-pGpbxWXHLpSFbPo5dNjMDOURTEek0fmf8ybz2vvp62Q30g%40mail.gmail.com.

Reply via email to