Tower of Babelfish
The Blog

In search of more efficient ways to learn languages.

  • Recent Posts

  • February 2014
    M T W T F S S
    « Dec    
     12
    3456789
    10111213141516
    17181920212223
    2425262728  
  • Archives

  • Meta

  • Tags

  • How to use iMacros to automate your word research

    Posted on by

    Screen Shot 2013-01-28 at 9.48.46 AMWhen I learn a new word, I look it up in 4 places:

    1. Google Images on Steroids (Hungarian site, basic mode, inside of Google Translate) [I talk about setting this up here]
    2. Forvo.com for audio recording (Skipping to Hungarian entry directly)
    3. A decent Hungarian-English Dictionary (I use Sztaki szótár)
    4. A decent Hungarian-Hungarian Dictionary (I use Wikiszótár, inside of Google Translate)

    This gives me everything I need to make my cards quickly, but it’s a pain in the butt to enter my word into Anki, then do it 4 more times into the search fields, especially when #1 and #4 (the sites I’ve preloaded into Google translate) don’t let you enter things into their search fields directly (it kills the Google translate part).

    I found a solution last night.


    Here’s what it looks like:

    1. Click bookmark

    H1

    2. Dialog box pops up.

    H2

    3. Click OK, wait 4 seconds while the browser searches all by itself. Then I get this:

    H3

    It’s heaven. 4 tabs packed full of information, ready for dumping into Anki. I can spend my time learning about the word, instead of trying to navigate websites.

    Here’s how to do it

    This will take you 5-20 minutes, and you’ll need to deal with copying and pasting a bit of code. I’m giving you my code, and your job is to replace my Hungarian URLs with the URLs you need.

    Note: This tutorial shows you each step in Firefox. I hear word that the Chrome interface is a bit different. Since I can’t seem to get iMacros working on Chrome, you’ll need to adjust the steps accordingly.

    1. Get Firefox (or Chrome). iMacros only seems to work in these browsers. Screen Shot 2013-01-28 at 9.49.26 AM
    2. Get and install iMacros for Firefox (or Chrome, but I couldn’t get it to download. Let me know in the comments.) imacros
    3. When it’s all installed (you may need to restart your browser), you should see this icon in your navbar, to the right of the search bar. Click it. H5
    4. On the left, you’ll see a sidebar that looks like this: Screen Shot 2013-01-28 at 8.23.21 AM
    5. Press the Record tab Screen Shot 2013-01-28 at 8.25.23 AM
    6. Now you need to create a new dummy macro, which you’ll replace with your own code. Press the Record, (if a dialog about closing tabs comes up, press no), Stop, Save. Name it whatever you want.
    7. Switch to the edit tab. Up top, select your newly saved macro and press “Edit Macro” Screen Shot 2013-01-28 at 8.31.45 AM
    8. You’ll see an editor. Select all the text and delete it. Screen Shot 2013-01-28 at 8.34.08 AM
    9. Copy the code here:
      VERSION BUILD=7601105 RECORDER=FX
      PROMPT "Please enter a word:" !VAR1
      TAB T=1
      SET !TIMEOUT_PAGE 1
      URL GOTO=http://translate.google.com/translate?hl=en&sl=hu&tl=en&u=http%3A%2F%2Fwww.google.hu%2Fsearch%3Fq%3D{{!VAR1}}%26num%3D10%26hl%3Dhu%26tbo%3Dd%26site%3Dimghp%26tbm%3Disch%26sout%3D1%26biw%3D1075%26bih%3D696
      SET !ERRORIGNORE YES
      TAB T=2
      URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#hu
      TAB T=3
      URL GOTO=http://szotar.sztaki.hu/en/search?fromlang=hun&tolang=eng&searchWord={{!VAR1}}&langcode=en&u=0&langprefix=en%2F&searchMode=WORD_PREFIX&viewMode=full&ignoreAccents=0
      TAB T=4
      URL GOTO=http://translate.google.com/translate?sl=hu&tl=en&u=http%3A%2F%2Fwikiszotar.hu%2Fwiki%2Fmagyar_ertelmezo_szotar%2F{{!VAR1}}
      TAB T=1
    10. Here’s the complex part. You’ll need to replace my Hungarian URLs with the URLs for your language, and then paste that code into the Editor window.To do that, look at what the code is doing. It prompts you for a word and sticks it into a variable called {{!VAR1}}. Then it sticks {{!VAR1}} into the appropriate place on each of the horribly long URLs I search, and searches each website in turn on 4 different tabs.The easiest way to find your URLs is to search your websites for a word called {{!VAR1}}, then copy the URL you get. Alternatively, search for some dummy word, copy the URL, look for your word buried inside and replace it with {{!VAR1}}.  Then replace my URLs with yours, copy your new code and dump it into the editor window.
    11. On the bottom, click ‘Save and Close’
    12. You’re basically done. If you right click on your macro, you’ll be able to add it as a bookmark. H7 If it doesn’t seem to turn into a bookmark like it should (mine didn’t), then select the URL on the bottom of the window (starts with imacros://run/…), copy it, and make a bookmark manually (right click on your bookmark bar, go to “New bookmark”, name it, paste your bookmark into the Location box, click add.) Screen Shot 2013-01-28 at 9.22.17 AM
    13. You’re done! Open a new window (with 4 tabs open, make sure you’re in the leftmost tab), and run the script. Let me know in the comments what websites you use (and if you really want to be helpful, paste in/link to your code, so others can copy it.)

    Note: If you use some of the code examples in the comments thread, make sure they include these two lines somewhere near the beginning:

    SET !TIMEOUT_PAGE 1
    SET !ERRORIGNORE YES

    Otherwise, you’ll run into errors whenever one of your sites doesn’t load fast enough.

    27 thoughts on “How to use iMacros to automate your word research

    1. Mettler

      Hi!

      Fascinating stuff, thanks.

      I think, I did everything exactly as you wrote down (because I’m from Hungary) but
      I don’t get four separate tabs, all information is loaded on the same tab. (So, with the browser’s back button, I can check everything.)

      What can be the problem?

      Károly

      Reply
      1. gwyner Post author

        Oops! I forgot to say, you need to have a window with 4 tabs already open, and you need to be in the leftmost tab. I’ll add that.

        Reply
    2. acutia

      I just had the same problem. My solution was to figure how to auto open a tab for each, which is pretty easy. Just put the text “TAB OPEN” (without quotes) on a new line before the line where you name the separate tabs with the script. Those look like the following:
      TAB T=2

      You put a TAB OPEN on a line before each tab ID line and it will look something like this:
      8 TAB OPEN
      9 TAB T=2
      10 URL GOTO=http://de.pons.eu/deutsch-englisch/{{!VAR1}}

      It works for me.

      Reply
      1. gwyner Post author

        That will definitely work. I *think* that it will keep opening tabs every time you run it, so if you search for a bunch of words, you’ll need to close those tabs after you’re done with them.

        Reply
    3. Zach

      Hey,

      Great time saving trick Gabe! As a side note, when I search images in google.fr it gives me the same output as your translation page method, and when I scroll over the image the ‘context text’ shows up. Just an aside as a heads up to anyone who decides to use the code below!

      Sites:
      1. google.fr
      2. forvo
      3. wiktionarry (fr)
      4. linguee (fr to en)

      Reply
      1. Zach

        Hmm… code didn’t show up.

        VERSION BUILD=7601105 RECORDER=FX

        PROMPT "Please enter a word:" !VAR1
        TAB T=1
        SET !TIMEOUT_PAGE 1
        URL GOTO=http://www.google.fr/search?num=10&hl=fr&site=imghp&tbm=isch&source=hp&biw=1082&bih=666&q={{!VAR1}}&oq={{!VAR1}}&gs_l=img.12...1031.1031.0.2362.1.1.0.0.0.0.226.226.2-1.1.0...0.0...1ac.ia2kupchlvU
        SET !ERRORIGNORE YES
        TAB T=2
        URL GOTO=http://fr.forvo.com/search/{{!VAR1}}/
        TAB T=3
        URL GOTO=http://www.linguee.com/english-french/search?source=french&query={{!VAR1}}
        TAB T=4
        URL GOTO=http://fr.wiktionary.org/w/index.php?search={{!VAR1}}&title=Sp%C3%A9cial%3ARecherche
        TAB T=1

        If this doesn’t work than, then maybe go here… http://pastebin.com/NC6SS3Aj

        Reply
        1. veejay

          Hi Zach,

          Thanks so much for posting the French code. Have you had any issues with just the first part of the macro running? Most of the time I’m just getting the image results, and a runtime error:

          RuntimeError: Page loading timeout, URL: http://www.google.fr/search?num=10&hl=fr&site=imghp&tbm=isch&source=hp&biw=1082&bih=666&q=maison&oq=maison&gs_l=img.12…1031.1031.0.2362.1.1.0.0.0.0.226.226.2-1.1.0…0.0…1ac.ia2kupchlvU, line 6 (Error code: -802)

          Do you have any ideas? This will be so great once I get it working!

          Reply
            1. gwyner Post author

              It’s missing this line:
              SET !ERRORIGNORE YES
              Add it to the beginning and that will go away (it’s succeeding half the time because half the time Google is loading in less than 1 second, and the other half of the time, it’s loading longer than 1 second, causing an error, at which point the script panics and stops. If you use SET !ERRORIGNORE YES, then it’ll just keep going when that happens (and the page will load normally, in the background)

        2. Dermius

          I have created two almost identical macros, one to start a session (creating the 4 tabs) and then the other to use the tabs that are open. Putting in code to conditionally close some tabs etc. is more cumbersome than just using two macros. Below is the code for the ‘start_ankiCardCreate_session’. The code for ‘continue_ankiCardCreate_session’ is identical but has all the lines with ‘TAB OPEN’ deleted or commented out.

          VERSION BUILD=7601105 RECORDER=FX

          PROMPT “Please enter a word:” !VAR1
          TAB T=1
          SET !TIMEOUT_PAGE 1
          URL GOTO=http://translate.google.com/translate?hl=en&sl=fr&tl=en&u=http%3A%2F%2Fwww.google.hu%2Fsearch%3Fq%3D{{!VAR1}}%26num%3D10%26hl%3Dhu%26tbo%3Dd%26site%3Dimghp%26tbm%3Disch%26sout%3D1%26biw%3D1075%26bih%3D696http://translate.google.com/translate?hl=en&sl=hu&tl=en&u=http%3A%2F%2Fwww.google.hu%2Fsearch%3Fq%3D{{!VAR1}}%26num%3D10%26hl%3Dhu%26tbo%3Dd%26site%3Dimghp%26tbm%3Disch%26sout%3D1%26biw%3D1075%26bih%3D696
          SET !ERRORIGNORE YES
          TAB OPEN
          TAB T=2
          URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#fr
          TAB OPEN
          TAB T=3
          URL GOTO=http://www.linguee.com/english-french/search?source=french&query={{!VAR1}}
          TAB OPEN
          TAB T=4
          URL GOTO=http://fr.wiktionary.org/w/index.php?search={{!VAR1}}&title=Sp%C3%A9cial%3ARecherche
          TAB T=1

          Reply
    4. gwyner Post author

      Some code for anyone learning Chinese (from the Reddit thread). I changed the !TIMEOUT_PAGE down to 1 , because otherwise you need to wait for each page to load before it will load the next tab:

      PROMPT “Please enter a Chinese word:” !VAR1
      TAB T=1
      SET !TIMEOUT_PAGE 1
      URL GOTO=http://translate.google.com/#zh-CN/en/{{!VAR1}}
      SET !ERRORIGNORE YES
      TAB T=2
      URL GOTO=http://www.jukuu.com/search.php?q={{!VAR1}}
      TAB T=3
      URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#zh
      TAB T=1

      Reply
    5. Mike

      Here’s a German one:

      http://pastebin.com/uaHnQW96

      It won’t let me edit it, so I can’t add the TAB OPEN lines.

      TAB OPEN works in Firefox 18.0.1, but if you created the bookmark without them, you may have to delete it and re-add it. Also, it uses the currently active tab as T1, so you may want to start with a blank one.

      If anyone who uses this discovers some brokenness or has better dictionary suggestions, please post them.

      Reply
    6. Daniel

      Great idea! Here’s my code for Spanish:

      VERSION BUILD=6011206 RECORDER=CR
      PROMPT “palabra de espanol:” !VAR1
      TAB T=1
      URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#es
      TAB T=2
      URL GOTO=http://www.wordreference.com/es/en/translation.asp?spen={{!VAR1}}
      TAB T=3
      URL GOTO=http://www.linguee.com/english-spanish/search?source=spanish&query={{!VAR1}}
      TAB T=4
      URL GOTO=http://www.spanishdict.com/translate/{{!VAR1}}
      TAB T=5
      URL GOTO=http://translate.google.com/#es/en/{{!VAR1}}
      TAB T=6
      URL GOTO=http://www.google.com/search?q={{!VAR1}}&hl=en&tbo=d&site=imghp&tbm=isch&sout=1&biw=1366&bih=643

      Does anybody know if there is a command that would allow the macro to proceed to the next tab without waiting for the current tab to finish loading? I’m running Windows with Google Chrome.

      Reply
      1. gwyner Post author

        Yeah, use these in the beginning:

        SET !TIMEOUT_PAGE 1
        SET !ERRORIGNORE YES

        1. Stops waiting for a page to load after 1 second (but causes an error notice)
        2. Ignores error notices, continuing to the next line of code whenever it gets one.

        Reply
      2. Andrew

        Hi,

        I have added the corrections to the code and set for firefox - thanks Daniel!

        VERSION BUILD=6011206 RECORDER=FX
        PROMPT “palabra de espanol:” !VAR1
        TAB T=1
        SET !TIMEOUT_PAGE 1
        URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#es
        SET !ERRORIGNORE YES
        TAB T=2
        URL GOTO=http://www.wordreference.com/es/en/translation.asp?spen={{!VAR1}}
        TAB T=3
        URL GOTO=http://www.linguee.com/english-spanish/search?source=spanish&query={{!VAR1}}
        TAB T=4
        URL GOTO=http://www.spanishdict.com/translate/{{!VAR1}}
        TAB T=5
        URL GOTO=http://translate.google.com/#es/en/{{!VAR1}}
        TAB T=6
        URL GOTO=http://www.google.com/search?q={{!VAR1}}&hl=en&tbo=d&site=imghp&tbm=isch&sout=1&biw=1366&bih=643
        TAB T=1

        Reply
        1. Andrew

          Sorry - don’t know how to paste “straight” quotation marks - when you paste this into the editor - you will need to replace the quotation marks in line 2 with new quotation marks.

          Reply
    7. Reeves

      I’m curious as to how you are using the “Language” to English dictionary. I thought a key part of your method was only working within your target language when studying?

      Reply
      1. gwyner Post author

        Good question.

        Back when I did French, I was a real stickler for translation, using only 100% French grammar books, 100% French dictionaries and avoiding Google translate whenever I could.

        After Russian, I’ve learned to be a little less rigid, though I still don’t allow English on my actual Anki cards. Of the 3 dictionaries I now use (Google Images in Google Translate, Bilingual Dictionary, Monolingual Dictionary in GT), none of them are 100% Hungarian. I use the bilingual dictionary just to doublecheck that the word seems to mean what I think it means (and that the word *shows up* in the dictionary; I’ve caught a few spelling mistakes by noticing when a word doesn’t show up). I rarely use that source, but I find it handy to have around in case of a troublesome word that doesn’t seem to give me any sensible images or example sentences.

        The other two sources are originally Hungarian, so I can be sure I’m getting an authentic (if badly translated) sense of what the word means. I’ll take that definition and come up with a picture or two to capture it (and if it’s an abstract word, then I’ll look for a good sentence with the word in context). The translations let me find good example sentences and get a sense of the word’s usage very quickly, and they let me do it without having *any* background in Hungarian grammar. And while I do remember the translation initially, I usually forget it within a week or two. Because what I see on my flashcards is 100% Hungarian+Pictures, I just don’t have enough English stimulation to keep the translation in mind. In the end, I get what I want (a 100% Hungarian word in my head) without having to struggle through texts that are way over my head in terms of grammar and vocabulary. Later, when I have a good foundation and can mostly understand what I read, then I’ll keep using the Google Image/Monolingual dictionary translations, but this time, I’ll search for surrounding words I *don’t* know. Then I’ll use *those* sentences/definitions on my cards (in 100% Hungarian) and get additional passive vocab for every word I learn.

        Reply
    8. Dave

      Here is what I am using for Russian:

      1) Google Trans + Images
      2) Forvo (for pronunciation)
      3) Abbyy Lingvo (Russian to English)
      4) Wiki Slovar (Russian to Russian)

      My code:

      VERSION BUILD=7601105 RECORDER=FX

      PROMPT “Please enter a word:” !VAR1
      SET !ERRORIGNORE YES
      TAB T=1
      SET !TIMEOUT_PAGE 1
      URL GOTO=http://translate.google.com/translate?hl=en&sl=ru&tl=en&u=http%3A%2F%2Fwww.google.ru%2Fsearch%3Fq%3D{{!VAR1}}%26num%3D10%26hl%3Dhu%26tbo%3Dd%26site%3Dimghp%26tbm%3Disch%26sout%3D1%26biw%3D1075%26bih%3D696
      SET !ERRORIGNORE YES
      TAB T=2
      URL GOTO=http://www.forvo.com/word/{{!VAR1}}/#ru
      TAB T=3
      URL GOTO=http://lingvopro.abbyyonline.com/en/Translate/ru-en/{{!VAR1}}
      TAB T=4
      URL GOTO=http://ru.wiktionary.org/wiki/{{!VAR1}}
      TAB T=1

      Reply
      1. Dave

        EDIT URL 1 in the ABOVE POST:

        Use URL GOTO=http://translate.google.com/translate?hl=en&sl=ru&tl=en&u=http%3A%2F%2Fimages.google.com%2Fsearch%3Fq%3D%D0%BA%D0%BE%D0%B3%D0%B4%D0%B0%26btnG%3D{{!VAR1}}%26tbm%3Disch%26hl%3Den%26sout%3D1%26biw%3D1080%26bih%3D722%26gbv%3D2%26gs_sm%3De%26gs_upl%3D2527l4331l0l4492l7l7l1l0l0l0l226l895l0.3.2l5l0

        Reply
    9. Dave

      Gabe, please delete the above edit if able.

      ————-

      Ignore the above edit. It also has issues. Here is the final working URL for Google Translate for Russian:

      GOTO=http://translate.google.com/translate?hl=en&sl=ru&tl=en&u=http%3A%2F%2Fimages.google.com%2Fsearch%3Fq%3D{{!VAR1}}%26btnG%3D%D0%B2%D1%80%D0%B5%D0%BC%D1%8F%26tbm%3Disch%26hl%3Den%26sout%3D1%26biw%3D1080%26bih%3D722%26gbv%3D2%26gs_sm%3De%26gs_upl%3D2527l4331l0l4492l7l7l1l0l0l0l226l895l0.3.2l5l0

      Reply
    10. Pingback: How to Search Multiple Websites Fast (for Learning a Language)

    11. Kurt

      Gabe,
      I don’t know how to say this…I’m a completely straight guy…but I love you man. This is wonderful.

      Kurt

      Reply
    12. Cat

      how can I add a code that automatically has “how to say ‘X’ in French’ ?
      I want to open up specific sites e.g Google searching for words and phrases in English translated to French with the phrase ‘how to say in french’ already typed in the search bar so I don’t have to type that repeatedly and the prompt will add in the words or phrases I type.
      Ive tried searching “how to say !VAR1 in French’
      and ‘how to say in French !VAR1′
      coping the URLs thinking the prompt ‘type in a word’ would replace !VAR1 with the prompted typed word or phrase.

      Reply

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Note: For anti-spam reasons, if you put a link in your post, it will be moderated. Post *another* comment (without any links) referring to your other comment and I will look through the moderation queue and save it from certain doom