AutoHotKey script for searching the selected text in PDF-xchange , and another for program→browser
Posted: Fri Dec 09, 2022 9:58 am
Thought I'd let you guys know of this script here; which basically through a keyboard shortcut (that you can change, but in this case it is Win+W and Win+Shift+W) basically copies what you have selected to your clipboard and searches for it on Google or DDG.
You could modify it to your liking by making it go to some dictionary/encyclopedia page instead.
To be honest I've thought about a script that does the opposite, basically takes what you have selected, copies it to your clipboard and searches for it for you in the PDF xchange advanced search section – So I would appreciate it if anyone could help with that (e.g. you select something in your browser, and it searches for that in pdf xce – based on what you've set the search to, a particular window , or all tabs. Would be nice to not have to copy paste it over manually all the time and click search)
I'm also using internet search by, but when you use that what you search does not get copied to your clipboard
about the idea of a script that searches what you've selected (or the latest thing you've copied) in PDF xce even though it is not the active window – all it would need to do would be to copy the selected text → switch to pdf xce as the active window. → use the active advanced search shortcut→ , paste it in , → search (enter). Seems possible.
You could modify it to your liking by making it go to some dictionary/encyclopedia page instead.
To be honest I've thought about a script that does the opposite, basically takes what you have selected, copies it to your clipboard and searches for it for you in the PDF xchange advanced search section – So I would appreciate it if anyone could help with that (e.g. you select something in your browser, and it searches for that in pdf xce – based on what you've set the search to, a particular window , or all tabs. Would be nice to not have to copy paste it over manually all the time and click search)
I'm also using internet search by, but when you use that what you search does not get copied to your clipboard

Code: Select all
;Some improvements with the help of andreas@ESA:~$ sudo -i
#w::searchOrVisitFromClip("https://www.google.com/search?q=")
#+w::searchOrVisitFromClip("https://duckduckgo.com/?q=")
searchOrVisitFromClip(searchUrl){
clip := clipboardAll
clip := ""
send, ^c
ClipWait, 0.5
if(ErrorLevel){
} else if (clipboard ~= "^https?:\/\/") { ; if clipboard content is an http or https protocol url
run, % clipboard
} else { ;search using the provided url
run, % searchUrl clipboard
}
clipboard := clip ;put the last copied thing back in the clipboard
}