Page 1 of 1

Save the contents of the clipboard to a file

Posted: Jun 2nd, ’22, 18:36
by Ennovy
If have this script to save the contents of the clipboard to a file:

Hotkey: CTRL + WIN + V
Command:

Code: Select all

;Save clipboard contents to file
File:="p:\werkmap\klembord.txt"				;Filename and path
;FileDelete, %File%					;Only if you want to remove the old file first
clipboard := clipboard " Text to append."		;Append some text to the clipboard.
FileAppend, %Clipboard%, %File%				;Write to file
Can I append an ENTER command to the text before I write it to the file?

Thanks,
Peter

Re: Save the contents of the clipboard to a file

Posted: Jun 2nd, ’22, 19:02
by Marko
You can use `n in the text for a new line.

Code: Select all

clipboard := clipboard "`nText to append."

Re: Save the contents of the clipboard to a file

Posted: Jun 2nd, ’22, 19:06
by Ennovy
Marko wrote: Jun 2nd, ’22, 19:02 You can use `n in the text for a new line.

Code: Select all

clipboard := clipboard "`nText to append."
Thank you Marko!