Author |
Topic |
|
Alex22
Ukraine
19 Posts |
Posted - 05/02/2016 : 11:22:46
|
I want to create an action for opening hyperlinks in alternative browser. I now how to send URL from clipboard to any browser, but I have no idea how to extract URL from clickable hyperlink. |
|
Rob
USA
2615 Posts |
Posted - 05/05/2016 : 01:15:47
|
That's going to be a bit tricky. Your best bet is going to be to perform the steps to right-click and select the copy link menu option, then get the url from the clipboard and run the alternate program. The steps to do this would vary by browser, but it is possible.
The starting basis of the script is detailed here http://www.strokesplus.com/forum/topic/449/new-tab-link-in-new-tab?SearchTerms=acconsumephysicalinput. But you'd also need to use acSendKeys to send the correct letter to select the desired menu option (e.g. Copy Link Location), then acGetClipboardText(), then acRunProgram to open the other browser, or a combination of code to see if the other browser is already running, etc. |
|
|
Alex22
Ukraine
19 Posts |
Posted - 05/06/2016 : 04:50:55
|
This method is applicable for browser, mail client, instant messager, maybe some other application. But I looking for some trick to copy URL from application, where there are no corresponding menu for hyperlink (text/RTF editor, PIM, movie organizer). Is it impossible?
|
Edited by - Alex22 on 05/06/2016 04:52:45 |
|
|
Rob
USA
2615 Posts |
Posted - 05/07/2016 : 19:09:08
|
Are you able to highlight the text, then send CTRL+C [acSendKeys("^c")]? Once you have it copied, you can call acGetClipboardText() to get the URL then it's just a matter of running the appropriate program and pass in the URL. |
|
|
Alex22
Ukraine
19 Posts |
Posted - 05/22/2016 : 11:36:04
|
Highlighting the text of link required accuracy, it's burdensome. And I realize the idea some time ago via AHK-skript (menu-on-selection) but look for something more convenient.
|
|
|
Rob
USA
2615 Posts |
Posted - 05/23/2016 : 10:18:48
|
Honestly, that's going to be rather difficult. Short of getting the text of the control (which is going to vary between applications), then parsing out the text to find if a URL is present (probably won't work at all if there is more than on, if you had an RTF text area)...I can't really think of a single, reliable method to accomplish that. |
|
|
|
Topic |
|
|
|