New
#21
Yes, and overall much better than repeated multiple Cntl-C Cntl-V.
Thanks again.
I still think AutoHotKey might do it, but beyond me to figure out what's wrong and this is a lot easier.
Yes, and overall much better than repeated multiple Cntl-C Cntl-V.
Thanks again.
I still think AutoHotKey might do it, but beyond me to figure out what's wrong and this is a lot easier.
Just to add, using Snip and Sketch I've gotten 24 items in the Clipboard. When I use Windows key + V to open the Clipboard I only have to click on any one to Paste into programs or dialog boxes such as used here. Haven't checked lately but believe Microsoft Office 2007 or 2010 started the increase in the clipboard size/capacity.
Why not just use AutoHotkey for the constant text, leaving CTRL+c/CTRL+v for 'normal' copy/paste activity?
I understand from the additional posts that the constant text needs to end with a carriage return (or linefeed) but that can be added easily to your AHK code.
For example, the following uses CTRL+1 to send text (including a carriage return) assigned to a variable:
Code:constant_txt = ( Line 1 of text. Line 2 of text. Line 3 of text (and the next line, i.e. a backtick followed by r, adds a carriage return). `r ) Return ^1:: SendInput,% constant_txt Return
If `r (backtick and r = carriage return) doesn't work for you then replace with `l (backtick and l = linefeed) instead.
(Note: Use SendInput in your AHK code instead of SendRaw... it's MUCH faster.)
Hope this helps...
Last edited by RickC; 10 Feb 2020 at 05:01.
Rick, the problem here as far as I understand is that when the lines get fed into Chrome's Console, each of them gets interpreted individually instead of as a block of javascript, and it keeps throwing an error after each line where a javascript function has not been terminated (this is my interpretation of it, as I have virtaully zero knowledge of javascript). The most likely solution would involve feeding the Constant Code as a 'block' rather than line by line.
I think a Clipboard swap might work. Something like below, although I unfortunatley, I don't have time to debug it fully.
Code:;Enter the raw contents of a file at cursor position ; shortcut is Control + L ; store full ormatted javascript in java1.txt file ; NO quotes around full file path to java1.txt ; use Sendraw instead of send to prevent mis-interpretation of AHK controls ; swap javatest.txt into clipboard temporarily and swap it out when done ^l:: Clip1:=ClipboardAll ;save the original Clipboard contents to Clip1 FileRead, Clipboard, C:\Dos\insand\ahk\java1.txt ;read contents of java1.txt to new Clipboard Clip2:=Clipboard ;save the new clipboard as Clip2 for logic only ClipWait, 0.250 send ^v ClipWait, 0.250 Clipboard:=Clip1 ;restore original Clipboard ClipWait, 0.250 return
Last edited by das10; 10 Feb 2020 at 07:39.