Run the script, type something into the input field and see what happens.
suggestURL := "http://www.google.com/complete/search?hl=en&js=true&qu=" searchURL := "http://www.google.com/search?client=opera&rls=en&sourceid=opera&ie=utf-8&oe=utf-8&q=" tempfile = %temp%\suggest settimer, timer, 1000 oldinput = Gui, Add, Edit, x6 y11 w400 h22, Gui, Add, ListView, x6 y35 w400 h250, Query|Number of results Gui, Add, Button, Default gGo, &Go Gui, Show, Center h320 w413, Google Suggest timer: guicontrolget, text,, Edit1 if (text = oldinput) return LV_Delete() oldinput := text if (text = "") return query := EncodeURL(text) urldownloadtofile, %suggestURL%%query%, %tempfile% fileread, suggestions, %tempfile% FileDelete, %tempfile% beginstr = new Array( len := strlen(beginstr) pos := instr(suggestions, beginstr) pos := pos + len endpos := instr(suggestions, ")", true, pos) stringmid, results, suggestions, % pos, % endpos - pos result_to_array(results, "results") pos := instr(suggestions, beginstr, true, endpos) pos := pos + len endpos := instr(suggestions, ")", true, pos) stringmid, resultnums, suggestions, % pos, % endpos - pos result_to_array(resultnums, "resultnums") options = Select loop, % numresults { query := results%a_index% num := resultnums%a_index% LV_Add(options, query, num) options = } LV_ModifyCol() return guiescape: gui, hide return Go: Gui, submit selected := LV_GetNext() if (selected = 0) msgbox, no query else { LV_GetText(selection, selected) query := EncodeURL(selection) run, %searchURL%%query% } return result_to_array(results, outvar) { global stringsplit, splitresults, results, " numresults := (splitresults0 - 1) // 2 pos = 2 loop, % numresults { %outvar%%a_index% := splitresults%pos% pos += 2 } } ; ; ; by shimanov, copied from AHK forum ; EncodeURL( p_data, p_reserved=true, p_encode=true ) { old_FormatInteger := A_FormatInteger SetFormat, Integer, hex unsafe = ( Join LTrim 25000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20 22233C3E5B5C5D5E607B7C7D7F808182838485868788898A8B8C8D8E8F9091929394 95969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6 B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8 D9DADBDCDDDEDF7EE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9 FAFBFCFDFEFF ) if ( p_reserved ) unsafe = %unsafe%24262B2C2F3A3B3D3F40 if ( p_encode ) loop, % StrLen( unsafe )//2 { StringMid, token, unsafe, A_Index*2-1, 2 StringReplace, p_data, p_data, % Chr( "0x" token ), `%%token%, all } else loop, % StrLen( unsafe )//2 { StringMid, token, unsafe, A_Index*2-1, 2 StringReplace, p_data, p_data, `%%token%, % Chr( "0x" token ), all } SetFormat, Integer, %old_FormatInteger% return, p_data }