1
votes

Is there a way to copy link text to the clipboard with autohotkey. In my situation I would like to capture the link text using Control-LeftClick, I then manipulate the text and construct a new link and navigate. Currently I am doing:

browser="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Send, ^c 
Sleep 200
Run, %browser%  mySite.com/?s=%Clipboard%& ...
Return

However rather than using Send, ^c to copy the text when I select it, it would be much nicer if I could just get the text by using control-LeftClick on the link, selecting the link text without accidentally clicking it can be clumsy.

Any ideas?

1

1 Answers

0
votes

First:

Install this Chrome extension: https://chrome.google.com/webstore/detail/copy-link-address/kdejdkdjdoabfihpcjmgjebcpfbhepmh?hl=en


Second:

a. If you want to copy to the clipboard link adress that is under your mouse cursor and after open that link to another window use this code:

^LButton::

    Send, ^c
    Send, {Ctrl Down}
    Click
    Send, {Ctrl Up}

return

b. If you want to copy to the clipboard link adress that is under your mouse cursor but dont open that link to another window use this code:

^LButton::

    Send, ^c

return




Also, always use AutoHotkey and its documenatation from http://ahkscript.org/ (current uptodate version, new official website)! AutoHotkey and its documentation from autohotkey.com is outdated and you may have some problems using them!