Happy Hobbit 发表于 2022-7-5 18:08:28

Put the (text) contents of the

I'm currently amending a lisp that overwrites multiple text strings with preset strings. I'd like to add to it's functionality by including an option to overwrite a string with the contents of the clipboard, provided the clipboard contains only text characters.
 
Bit of pseudo code:
 

(setq newtext "contents of clipboard")

Lee Mac 发表于 2022-7-5 18:31:39

I would recommend these Clipboard Functions by MP at The Swamp.
 
For your task:

(setq newtext (_GetClipBoardText))

Happy Hobbit 发表于 2022-7-5 18:57:58

Thanks Lee, MP & Patrick_35 for the original
 
Works a treat !
 
 
PS
Further to the above, I've added the functionality to your PSTEXT lisp Lee, for prefix & suffix clipboard text !

Lee Mac 发表于 2022-7-5 19:24:02

Excellent! - You're welcome Harry.
页: [1]
查看完整版本: Put the (text) contents of the