Save the contents of the clipboard to a file

Share your favorite FastKeys commands
Post Reply
User avatar
Ennovy
Posts: 70
Joined: Mar 18th, ’14, 08:46

Post by Ennovy » Jun 2nd, ’22, 18:36

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
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Jun 2nd, ’22, 19:02

You can use `n in the text for a new line.

Code: Select all

clipboard := clipboard "`nText to append."
User avatar
Ennovy
Posts: 70
Joined: Mar 18th, ’14, 08:46

Post by Ennovy » Jun 2nd, ’22, 19:06

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!
Post Reply