[SOLVED] Clipboard madness Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
thenasos
Posts: 79
Joined: 10 Nov 2015, 10:00

[SOLVED] Clipboard madness

10 Nov 2015, 10:17

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
Shrek is love...
User avatar
MasterFocus
Posts: 146
Joined: 01 Oct 2013, 09:47
Location: Rio de Janeiro - RJ - Brasil
Contact:

Re: Clipboard madness  Topic is solved

10 Nov 2015, 10:23

*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...
Antonio França - git.io | github.com | ahk4.net | sites.google.com
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
grant
Posts: 323
Joined: 14 Oct 2015, 17:27

Re: Clipboard madness

10 Nov 2015, 10:37

Do you need the *c parameter? Reading from a txt file, I imagine it is not needed.
User avatar
MasterFocus
Posts: 146
Joined: 01 Oct 2013, 09:47
Location: Rio de Janeiro - RJ - Brasil
Contact:

Re: Clipboard madness

10 Nov 2015, 10:39

@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.
Antonio França - git.io | github.com | ahk4.net | sites.google.com
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
User avatar
thenasos
Posts: 79
Joined: 10 Nov 2015, 10:00

Re: Clipboard madness

11 Nov 2015, 03:11

It works, damn it works! :D
Thank you!
Shrek is love...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: nacken012, peter_ahk, Rohwedder and 145 guests