The 'Link' is a 16 digit number, on a website that is clickable, but when you mouse over it and right click, there is no direct COPY option.
Only the standard:
Save Link as...
Copy Link
etc
Is there a way for AHK to 'force' copy that 16 digit number?
When I use my mouse and and left click (from the left of the first #) and drag to the right, obviously I get the highlight I want and then I can press CRTL+C or simply right click and select copy.
Id rather not have the mouse pointer involved here, so I can keep the code clean and as error-less as possible. I have tried the Shift and arrow, no luck.
Thanks in advance.
Using copy for a link that you cannot right click and 'copy'?
Re: Using copy for a link that you cannot right click and 'copy'?
Code: Select all
MouseClickDrag, left, 481, 197, 624, 197
Send, ^c
EDIT: actually it does not work because the 'click' is lifted before I can COPY the text
Last edited by chef423 on 27 Apr 2017, 14:48, edited 1 time in total.
Re: Using copy for a link that you cannot right click and 'copy'?
You could try this (requires the Acc library):
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Otherwise you could use Internet Explorer and COM.
Code: Select all
q:: ;get text from element/control/window under cursor
oAcc := Acc_ObjectFromPoint()
;hWnd := Acc_WindowFromObject(oAcc)
vText1 := vText2 := ""
try vText1 := oAcc.accName(0)
try vText2 := oAcc.accValue(0)
;Clipboard := vText1 "`r`n" vText2 "`r`n"
Clipboard := "accName: " vText1 "`r`n" "accValue: " vText2 "`r`n"
return
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Otherwise you could use Internet Explorer and COM.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Using copy for a link that you cannot right click and 'copy'?
Thank you.jeeswg wrote:You could try this (requires the Acc library):Acc library (MSAA) and AccViewer download links - AutoHotkey CommunityCode: Select all
q:: ;get text from element/control/window under cursor oAcc := Acc_ObjectFromPoint() ;hWnd := Acc_WindowFromObject(oAcc) vText1 := vText2 := "" try vText1 := oAcc.accName(0) try vText2 := oAcc.accValue(0) ;Clipboard := vText1 "`r`n" vText2 "`r`n" Clipboard := "accName: " vText1 "`r`n" "accValue: " vText2 "`r`n" return
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Otherwise you could use Internet Explorer and COM.
I am using this:
Code: Select all
MouseClickDrag, L, 481, 197, 630, 197, 50
SetMouseDelay, 100
Send, ^c
hmmm...
(I have to use Google Chrome for this project)
Re: Using copy for a link that you cannot right click and 'copy'?
Maybe you can play about with this code to achieve what you want. I'm still having an issue that if LButton is held down, ctrl+c to copy doesn't work, although perhaps this can be resolved.
[EDIT:] I'm not sure why I thought Shift was necessary, [EDIT 2: shift+arrows is needed to select text via the keyboard] anyway, this script may actually work for you in its current form:
Code: Select all
q:: ;drag and copy
MouseMove, 481, 197
Send {LButton Down}{Shift Down}
Sleep 100
MouseMove, 630, 197
Sleep 100
Clipboard := ""
Send {LButton Up}{Shift Up}^c
ClipWait, 3
MsgBox, % Clipboard
return
Code: Select all
q:: ;drag and copy
MouseMove, 481, 197
Send {LButton Down}
MouseMove, 630, 197
Clipboard := ""
Send ^c{LButton Up}
ClipWait, 3
MsgBox, % Clipboard
return
Last edited by jeeswg on 27 Apr 2017, 16:51, edited 2 times in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
- Almost_there
- Posts: 404
- Joined: 30 Sep 2014, 10:32
Re: Using copy for a link that you cannot right click and 'copy'?
If you're using Firefox (haven't tested this on other web browsers) you can jump around between links and other elements on a web site simply by pressing Tab. Then you'll get the normal right-click option using AppsKey. Maybee that works.
Re: Using copy for a link that you cannot right click and 'copy'?
Thank you everyone...
Who is online
Users browsing this forum: No registered users and 76 guests