Writing the clipboard to a file is easy:
GetClipBoard>WhatsInTheClipBoard1
WriteLn>C:\file.txt,result,WhatsInTheClipBoard2
How I put the file contents in the clipboard so that the arrangement (newline chars) is not changed?
How do I put a text file contents in the clipboard?
Moderators: JRL, Dorian (MJT support)
Windows with TWO clipboards. Test it.
One way to put text from a file in clipboard is given in the script Clipboard2 Paste.scp.
Clipboard2 COPY.scp
GetClipBoard>WhatsInTheClipBoard1
rem Message>WhatsInTheClipBoard1
Press CTRL
Send Character/Text>c
Release CTRL
GetClipBoard>WhatsInTheClipBoard2
rem Message>WhatsInTheClipBoard2
Let>file=TEMP_DIR
ConCat>file,clipboard2.txt
PutClipBoard>WhatsInTheClipBoard1
DeleteFile>file
WriteLn>file,result,WhatsInTheClipBoard2
Clipboard2 Paste.scp
Let>file=TEMP_DIR
ConCat>file,clipboard2.txt
ReadLn>file,1,entiretext
Let>k=2
Label>start
ReadLn>file,k,line
If>line=##EOF##,finish
Let>entiretext=%entiretext%%CR%%line%
Let>k=k+1
Goto>start
Label>finish
GetClipBoard>WhatsInTheClipBoard1
PutClipBoard>entiretext
Press CTRL
send>v
Release CTRL
PutClipBoard>WhatsInTheClipBoard1
sometimes in my Win98se the copy (CTRL-ALT-C) shows "cannot open clipboard"
...and the paste text (CTRL-ALT-V) sometimes is different.
comments, improvements?
Clipboard2 COPY.scp
GetClipBoard>WhatsInTheClipBoard1
rem Message>WhatsInTheClipBoard1
Press CTRL
Send Character/Text>c
Release CTRL
GetClipBoard>WhatsInTheClipBoard2
rem Message>WhatsInTheClipBoard2
Let>file=TEMP_DIR
ConCat>file,clipboard2.txt
PutClipBoard>WhatsInTheClipBoard1
DeleteFile>file
WriteLn>file,result,WhatsInTheClipBoard2
Clipboard2 Paste.scp
Let>file=TEMP_DIR
ConCat>file,clipboard2.txt
ReadLn>file,1,entiretext
Let>k=2
Label>start
ReadLn>file,k,line
If>line=##EOF##,finish
Let>entiretext=%entiretext%%CR%%line%
Let>k=k+1
Goto>start
Label>finish
GetClipBoard>WhatsInTheClipBoard1
PutClipBoard>entiretext
Press CTRL
send>v
Release CTRL
PutClipBoard>WhatsInTheClipBoard1
sometimes in my Win98se the copy (CTRL-ALT-C) shows "cannot open clipboard"
...and the paste text (CTRL-ALT-V) sometimes is different.
comments, improvements?