newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: cameyo on October 09, 2023, 06:00:10 AM

Title: Windows clipboard
Post by: cameyo on October 09, 2023, 06:00:10 AM
Do you known a way to manage windows clipboard (cut, copy, paste)?
I have tried to use clipboard.dll with no luck.
Thanks.

cameyo
Title: Re: Windows clipboard
Post by: Yael on November 05, 2023, 02:41:18 AM
I use a call to pasteclipboard.exe to read from the clipboard. Here, an example:

(set 'option (exec "pasteclipboard.exe"))
(set 'optid (parse (option 0)))
(when (= (join optid) "0") (myfunction))
.
.
.

To put something on the clipboard I call clip.exe (all of this under Windows OS)
Title: Re: Windows clipboard
Post by: cameyo on November 06, 2023, 01:12:31 PM
Thanks.
I can use the "clip" command, but where is "pasteclipboard.exe" ?
I have found: "powershell get-clipboard" to get text from clipboard.
Title: Re: Windows clipboard
Post by: Yael on November 07, 2023, 02:01:55 AM
I am now attaching a zipped file with the pasteclipboard.exe here:
Title: Re: Windows clipboard
Post by: Yael on November 07, 2023, 02:12:09 AM
As an example, in a Windows *.bat file use this:

echo "%var%" | clip.exe
pasteclipboard.exe
yournewlispfile.exe

The file yournewlispfile.exe is your newlisp compiled file, which must include these commands:

(set 'option (exec "pasteclipboard.exe"))
(set 'myvar(parse (option 0)))

I know it is a dirty way of doing things, but honestly after struggling with dll's import I failed miserably.

Title: Re: Windows clipboard
Post by: cameyo on November 07, 2023, 06:29:32 AM
Thanks!