I'd appreciate help. The scropt below is what I need, except that the text created in the clipboard (appending browser text selection+URL) isn't formatted anymore. I mean, the formatting from the original text selected in the browser is lost in the script.
Is it possible to keep the text formatting in the script below?
Thanks for help!
Code: Select all
;http://www.donationcoder.com/forum/index.php?topic=26164.0
; Allow partial titlebar text matches.
SetTitleMatchMode, 2
; Create a window title group to match on for our hotkey.
GroupAdd, myBrowsers, Mozilla Firefox
GroupAdd, myBrowsers, Google Chrome
#IfWinActive, ahk_group myBrowsers
{
F2::
{
; Copy user selection to a variable.
SendInput, ^c
Sleep, 100
myText := Clipboard
Sleep, 100
; Switch to address bar in browser and copy URL to another variable.
SendInput, ^l
Sleep, 100
SendInput, ^c
Sleep, 100
myURL := Clipboard
Sleep, 100
; Format data bits.
myData := myText . "`r`n`r`n" . myURL
Sleep, 100
; Put formatted data back onto clipboard.
Clipboard := myData
}
Return
}
#IfWinActive