51
General Software Discussion / Re: Announcement: Pasty - pastes highlighted text into an external search engine
« on: June 17, 2009, 07:08 PM »
MilesAhead, I hope you don't mind if I post this. If you do just send me a PM or something and I'll delete it ASAP.
I wrote one of these for myself also. It's extremely useful!
Mine uses Winkey+c to copy the text then waits for you to hit another key for what type of search you want to do...
A - ask.com (I thought about trying out this search engine)
D - Dictionary (dictionary.reference.com)
E - eBay
F - acronym finder
G - Google
P - Pricegrabber
T - Thesaurus (thesaurus.reference.com)
U - UPS (for tracking numbers, I've been planning to make this also "figure out" what kind of tracking number is highlighted and take you to FedEx, UPS, or USPS as necessary)
W - Wikipedia
It sometimes didn't work right in Vista, I think there was some kind of issue with it watching the clipboard, but in the Windows 7 RC it has worked perfectly so far.
I bet if you look at the script you'll see that it's very easy to customize...
I wrote one of these for myself also. It's extremely useful!
Mine uses Winkey+c to copy the text then waits for you to hit another key for what type of search you want to do...
A - ask.com (I thought about trying out this search engine)
D - Dictionary (dictionary.reference.com)
E - eBay
F - acronym finder
G - Google
P - Pricegrabber
T - Thesaurus (thesaurus.reference.com)
U - UPS (for tracking numbers, I've been planning to make this also "figure out" what kind of tracking number is highlighted and take you to FedEx, UPS, or USPS as necessary)
W - Wikipedia
It sometimes didn't work right in Vista, I think there was some kind of issue with it watching the clipboard, but in the Windows 7 RC it has worked perfectly so far.
I bet if you look at the script you'll see that it's very easy to customize...
AHK script
;I'm calling this version 1.0 - sorry, I don't think I'll ever include a changelog
#c::
CB = %Clipboard%
Send ^c
Phrase = %Clipboard%
Clipboard = %CB%
Input, SingleKey, L1 T3
; ////////Replace Tabs and Line Breaks with Spaces
StringReplace, Phrase, Phrase, `r, %A_Space%, All
StringReplace, Phrase, Phrase, `n, %A_Space%, All
StringReplace, Phrase, Phrase, %A_TAB%, %A_Space%, All
; ////////Get rid of multiple spaces
Loop
{
StringReplace, Phrase, Phrase, %A_SPACE%%A_SPACE%, %A_SPACE%, All
StringGetPos, SpaceDouble, Phrase, %A_SPACE%%A_SPACE%, L1
If SpaceDouble < 0
{
Break
}
}
; ////////Ask
If SingleKey = a
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.ask.com/web?q=`%22%Phrase%`%22
}
; ////////Dictionary
Else If SingleKey = d
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://dictionary.reference.com/browse/%Phrase%
}
; ////////eBay
Else If SingleKey = e
{
StringReplace, Phrase, Phrase, %A_SPACE%, -, All
Run http://search.ebay.com/%Phrase%
}
; ////////Acronym Finder
Else If SingleKey = f
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.acronymfinder.com/af-query.asp?Acronym=%Phrase%
}
; ////////Google
Else If SingleKey = g
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.google.com/search?q=`%22%Phrase%`%22
}
; ////////PriceGrabber
Else If SingleKey = p
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.pricegrabber.com/search.php?form_keyword=%Phrase%
}
; ////////Thesaurus
Else If SingleKey = t
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://thesaurus.reference.com/browse/%Phrase%
}
; ////////UPS
Else If SingleKey = u
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://wwwapps.ups.com/WebTracking/processInputRequest?tracknum=%Phrase%
}
; ////////Wikipedia
Else If SingleKey = w
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://en.wikipedia.org/wiki/Special:Search?search=`%22%Phrase%`%22
}
Else
{
MsgBox Ended
Exit
}
Reload
return
#c::
CB = %Clipboard%
Send ^c
Phrase = %Clipboard%
Clipboard = %CB%
Input, SingleKey, L1 T3
; ////////Replace Tabs and Line Breaks with Spaces
StringReplace, Phrase, Phrase, `r, %A_Space%, All
StringReplace, Phrase, Phrase, `n, %A_Space%, All
StringReplace, Phrase, Phrase, %A_TAB%, %A_Space%, All
; ////////Get rid of multiple spaces
Loop
{
StringReplace, Phrase, Phrase, %A_SPACE%%A_SPACE%, %A_SPACE%, All
StringGetPos, SpaceDouble, Phrase, %A_SPACE%%A_SPACE%, L1
If SpaceDouble < 0
{
Break
}
}
; ////////Ask
If SingleKey = a
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.ask.com/web?q=`%22%Phrase%`%22
}
; ////////Dictionary
Else If SingleKey = d
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://dictionary.reference.com/browse/%Phrase%
}
; ////////eBay
Else If SingleKey = e
{
StringReplace, Phrase, Phrase, %A_SPACE%, -, All
Run http://search.ebay.com/%Phrase%
}
; ////////Acronym Finder
Else If SingleKey = f
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.acronymfinder.com/af-query.asp?Acronym=%Phrase%
}
Else If SingleKey = g
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.google.com/search?q=`%22%Phrase%`%22
}
; ////////PriceGrabber
Else If SingleKey = p
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://www.pricegrabber.com/search.php?form_keyword=%Phrase%
}
; ////////Thesaurus
Else If SingleKey = t
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://thesaurus.reference.com/browse/%Phrase%
}
; ////////UPS
Else If SingleKey = u
{
StringReplace, Phrase, Phrase, %A_SPACE%, `%20, All
Run http://wwwapps.ups.com/WebTracking/processInputRequest?tracknum=%Phrase%
}
; ////////Wikipedia
Else If SingleKey = w
{
StringReplace, Phrase, Phrase, %A_SPACE%, +, All
Run http://en.wikipedia.org/wiki/Special:Search?search=`%22%Phrase%`%22
}
Else
{
MsgBox Ended
Exit
}
Reload
return