0

I use F6 and ^{insert} to retrieve the URL. This works fine in Firefox, but fails in IE and Maxthon. Instead, my selection gets copied. If I do it manually, then it works in all browsers. Any workarounds?

SendEvent, {F6} 
SendEvent, ^{ins}
Clipwait
URL = %clipboard%
MsgBox, Your browser is: %browser%
MsgBox, URL copied: %URL%
Charles
  • 50,943
  • 13
  • 104
  • 142
Khalil
  • 311
  • 5
  • 16
  • I found the solution. You need to put a delay between the two sendevents. Check http://stackoverflow.com/questions/6275405/how-can-i-get-the-current-browser-url-with-an-autohotkey-script for alternative solutions. – Khalil Aug 06 '13 at 10:07
  • 3
    Khalil, please don't add `[Resolved]` to your questions. Instead, post your own answer below here in the box where it says, `Your Answer`. You'll get your questions closed if you continue this way - you've done it here, too: http://stackoverflow.com/questions/18070686/resolvedhow-to-evaluate-function-in-if-else-statement-autohotkey – bgmCoder Aug 06 '13 at 19:21
  • Possible duplicate of [How can I get the current browser URL with an AutoHotKey script?](https://stackoverflow.com/questions/6275405/how-can-i-get-the-current-browser-url-with-an-autohotkey-script) – Stevoisiak Sep 22 '17 at 18:38

1 Answers1

0

Putting a delay between the two sendevents worked for me. It provides enough time for the URL to be selected before the clipboard copy action takes place.

Khalil
  • 311
  • 5
  • 16