Page 1 of 1

[SOLVED] Clipboard madness

Posted: 10 Nov 2015, 10:17
by thenasos
Unable to save info to Clipboard from file.
Old Clipboard works fine, there must be something too obvious that I am missing here.

Code: Select all

::emailtmp2::
oldClip := clipboardAll
clipboard :=
FileRead, Clipboard, *c C:\Users\S62790\Desktop\Scripts\ahk\demo\parasai.txt
Send ^v
clipboard := oldClip
ifWinActive, ahk_class rctrl_renwnd32 
	{
	send !n{a}{s}
	sleep 200
	send {down}
	sleep 200
	send {space}
	}
return

Re: Clipboard madness  Topic is solved

Posted: 10 Nov 2015, 10:23
by MasterFocus
*c is for a ClipboardAll content, which is probably not what you have saved.
Try using another variable and making sure the Clipboard is filled:

Code: Select all

oldClip := ClipboardAll
Clipboard := ""
While ( Clipboard = "" ) {
    FileRead, my_temp_var, C:\Users\...\...\file.txt
    Clipboard := my_temp_var
    my_temp_var := ""
}
Send, ^v
;// etc...

Re: Clipboard madness

Posted: 10 Nov 2015, 10:37
by grant
Do you need the *c parameter? Reading from a txt file, I imagine it is not needed.

Re: Clipboard madness

Posted: 10 Nov 2015, 10:39
by MasterFocus
@grant: As I said, it probably makes no sense using *c here since (I suppose) it would be necessary to save a ClipboardAll-type content before trying to load it with FileRead.

Re: Clipboard madness

Posted: 11 Nov 2015, 03:11
by thenasos
It works, damn it works! :D
Thank you!