2nd Clipboard possible?  

Page 3 of 3 FirstFirst 123

  1. Posts : 261
    Win 10 Pro 64 Bit
    Thread Starter
       #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.
      My Computer


  2. Posts : 13,170
    Win10 Version 21H2 Pro and Home, Win11 Pro and Home
       #22

    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.
      My Computers


  3. Posts : 1,581
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #23

    James1093 said:
    I use Cntl-C and Cntl-V a lot but need to paste 2 things, one of which is a constant bit of text.
    Is there any way to assign this to another Key? So it will permenantly paste that text, leaving C & V to do the other bit?

    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.
      My Computer


  4. Posts : 3,249
    Win10
       #24

    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.
      My Computers


  5. Posts : 1,581
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #25

    das10 said:
    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
    @das10 - Ahh, after installing Chrome and finding the Console I can now see what you mean. I hadn't realised before.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:21.
Find Us




Windows 10 Forums