Jump to content

[SOLVED] Using Google Traslate in AutoIT

Recommended Posts

Hi guys,

I'm searching into the forum and find some old example, but no one working fo me, so i'll decide to make a new thread.

I want using it to automatic traslate a GUI

The problem is the response of the page, i have try to:

1) Save the output like ini/txt

2) Save the output like mht

I can't find the traslated text

For now i have make:

$test = @WorkingDir & "\test.mht"
$word = "Bonjour"
_INetGetMHT( ["http://translate.google.com/#auto|en|"] & $word, $test )
Func _INetGetMHT( $url, $file )
    Local $msg = ObjCreate("CDO.Message")
    If @error Then Return False
    Local $ado = ObjCreate("ADODB.Stream")
    If @error Then Return False
    With $ado
        .Type = 2
        .Charset = "US-ASCII"
    $msg.CreateMHTMLBody($url, 0)
    $msg.DataSource.SaveToObject($ado, "_Stream")
    $ado.SaveToFile($file, 1)
    $msg = ""
    $ado = ""
    Return True

How to read the box with tralsated text?

Thanks for support

EDIT: Sorry for the [ ] in _INetGetMHT, i can't remove it, or the forum process it like URL :)

Edited by johnmcloud
Link to post
Share on other sites

Ok guys, i'll find a workaround and i'll post later

I need to know how to read a file a .ini ( i know how ) but only the text in this space:

class="t0">I need only this text</div>

There is only one problem, can't go to next line, the text can be only on one line

EDIT: Solved with an array. If need i'll post all the script in example section. Thanks

Edited by johnmcloud
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...