5

I'm trying to cross check some info on a medical website for correctness. My goal is to highlight select phrases on this website then cross check the research on wikipedia, pubmed, ovid, Google and educus to insure what we're telling people is correct. I've been separate copy/pasting but I'm looking for a way to speed this task by copying then hitting a hotkey and having the sites auto search and open in a separate tab. I've tried Autohotkey.

^z::

send ^c

clipwait

run "http://en.wikipedia.org/wiki/Special:Search?search=%clipboard%&go=Go"

run "http://www.ncbi.nlm.nih.gov/pubmed?term=%clipboard%"

run "http://www.Google.com/search?hl=en&q=%clipboard%&btnG=Search"

run http://www.educus.com/

Winwait educus

Sendinput %clipboard% {Return}

return

I can't seem to figure out how to get this to work for Educus and Ovid. I'm a non programmer and a newb at this so simple language/explanation would be very helpful.

2
  • Looking at educus, it uses POST to submit the search - not sure if AutoHotkey would be of much use
    – Sathyajith Bhat
    Aug 15, 2011 at 4:27
  • Winwait waits for the given title to appear. In case of Educus it's Free Online Medical Journals | Search Abstract, so your Winwait educus won't work, because the Educus page does not have educus in the title.
    – Tom
    Aug 15, 2011 at 6:45

2 Answers 2

1

For Ovid it would be

run "http://www.ovid.com/cgi-bin/texis.cgi/webinator/search5/?pr=newovid2&order=r&query=%clipboard%&submit=Submit"  

Looking at educus, it uses POST to submit the search - not sure if AutoHotkey would be of much use. Will try to dig in and update.

0
Winwait educus

This will not work for three reasons:

  • There's no guarantee that the Educus window gets opened last.

    This is easily fixed by letting the script "sleep" beofre opening the last window.

  • The title of www.educus.com is Free Online ... Codes Search.

  • Even when the window is active, there's no guarantee the input field is already selected. You have to wait somehow for the page to load.

    One way to achieve this is to attempt to copy the sent text string to the clipboard and try again if it failed.

    However, this produces an annoying beeping sound every time. AutoHotkey can turn the sounds temporarily down, but you have to run it in Compatibility Mode (Windows XP Service Pack 3) if you're using Vista or higher.

Try this:

#z::
    Backup := ClipboardAll
    Send, ^c
    ClipWait
    Query := Clipboard
    Clipboard =
    Run, http://en.wikipedia.org/wiki/Special:Search?search=%Query%&go=Go
    Run, http://www.ncbi.nlm.nih.gov/pubmed?term=%Query%
    Run, http://www.google.com/search?hl=en&q=%Query%&btnG=Search
    Run, http://www.ovid.com/cgi-bin/texis.cgi/webinator/search5/?pr=newovid2&order=r&query=%Query%&submit=Submit
    Sleep, 100
    Run, http://www.educus.com/
    SoundGet, Volume
    SoundSet, -100
    Loop
    {
        WinWaitActive, Free Online
        SendInput, %Query%+{Home}^c{Right}
        Sleep, 1000
        if Clipboard = %Query%
            Break
    }
    SoundSet, %Volume%
    Clipboard := Backup
    Backup =
return

Note that I've also added a few lines to back the clipboard up. This way, whatever was stored in it before pressing the key combination will be restored. This is optional and can be removed.

I've also changed the key combination to Win + Z. Ctrl + Z is used for undoing changes in most applications.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .