Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

for example

this

None of the shortcuts are things you couldn't do within Windows with a few extra clicks or with a small 3rd-party app, but http://JDContextMenu.com bundles them together into a small menu with one-click ease. You can copy the full email@filename.com to the clipboard

Should be converted into this

None of the shortcuts are things you couldn't do within Windows with a few extra clicks or with a small 3rd-party app, but <a href="http://JDContextMenu.com" title="Opens in a new window" target="_blank">http://JDContextMenu.com</a> bundles them together into a small menu with one-click ease. You can copy the full <a href="mailto:email@filename.com">email@filename.com</a> to the clipboard

And i want to combine this facility with this script http://superuser.com/questions/98092/how-to-select-text-then-convert-with-html-tag

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This AutoHotkey script should work, identifying both URLs and email addresses.

ALT+p is the hotkey defined:

!p::
ClipSaved := ClipboardAll
Clipboard=
Send ^c
ClipWait, 2
clipcontent = %Clipboard%
; Regular Expressions from RegExLib.com
; First lets search for the URLs
clipcontent := RegExReplace(clipcontent, "Si)(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&amp;%_\./-~-]*)?", "<a href=""$0"">$0</a>")
; And then for the email addresses
clipcontent := RegExReplace(clipcontent, "Si)[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))", "<a href=""mailto:$0"">$0</a>")
Clipboard = <p>%clipcontent%</p>
ClipWait, 2
Send ^v
Clipboard := ClipSaved
ClipWait, 2
ClipSaved=
return
share|improve this answer
    
thanks, combine ut this script with this superuser.com/questions/98092/… –  metal gear solid Jan 27 '10 at 9:34
    
Already done by the line Clipboard = <p>%clipcontent%</p> –  Snark Jan 27 '10 at 9:37
    
cool, pls can u make this possible also superuser.com/questions/100870/… –  metal gear solid Jan 27 '10 at 10:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.