Jump to content

Recommended Posts

Posted

Dear helper,

1)I need to open a word document called DOC1

2) translate the first sentence in DOC 1 from english to spanish and copy the translated result in the same position (First sentence)

3 translate the 2nd sentence and copy the result in 2nd sentence position.

4 continu till the end of DOC1

5 Save the result as DOC2

Thank you for your help

Guillaume

Posted

I just worked on this for a few minutes, it's rough but it could help you get started.

#include <IE.au3>
$oIE = _IECreate("http://translate.google.com/?hl=en&eotf=0&sl=en&tl=es&q=#en|es|")
$File = "DOC1.txt"

_IELoadWait ($oIE)

Sleep(10000)
Send("Te")
Sleep(500)
Send("{Backspace 2}")
Sleep(500)

$sMyString = "instant"
$oLinks = _IELinkGetCollection($oIE)
For $oLink in $oLinks
    $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next


$ReadFile = FileReadLine($File, 1)
Send($ReadFile)
Sleep(500)
Send("{Enter}")
Sleep(1000)

This will translate the first line.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

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...