Jump to content

ZeNeto

Members
  • Posts

    7
  • Joined

  • Last visited

ZeNeto's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Dude i did that but when have a error the windows send menssage: the program stod working, do you want close program or restart the program =( Global $oMyError = ObjEvent("AutoIt.Error","recuperarErro") Func recuperarErro() main() EndFunc
  2. No, may you explain me with a example? Regrats
  3. Thanks dude, but this code is a example, thats isnt my real code, i want do a try catch to avoid stop my script
  4. Thanks dudes, i solved. I had office 2013 installed in my pc, i solved doing a downgrade to offfice 2007
  5. main() Func foo() Local $oWord Local $retorno = False Local $palavras[8] Local $achouHoras = False Local $Image = @MyDocumentsDir & "\a_teste.tif" _ScreenCapture_Capture($Image, 484, 243, 660, 263) Local $miDoc = ObjCreate("MODI.Document") If @error then recover() $miDoc.Create($Image) If @error then recover() $miDoc.Ocr(9, false, false) If @error then recover() ConsoleWrite($miDoc.Images(0)) If @error then recover() return something End func Func recover() main() End Func Func main() Do foo() sleep(2000) Until false End FuncDears, i have a script that must run 24h. I created a function to restart the execution if i have a error go to recover and back to execute again. But when the script have a error its stops the execution. What i have to do, to do not stop the execution like a Java try catch? Thanks Console: (94) : ==> The requested action with this object has failed.: $miDoc.Ocr(9, false, false) $miDoc^ ERROR >Exit code: 1 Time: 80.06
  6. Hello thanks for help, i discovered whats is wrong but i couldnt solve this problem. I have MS Office 2013 instaled but MODI is a default feature until MS Office 2007, how can i use MODI in office 2013?
  7. I`m trying read a text from a screencapture, i got this method here in autoit`s forum. But the error is: "C:\Users\jose.barbosaneto\Desktop\TESTE.au3" (23) : ==> Variable must be of type "Object".: $miDoc.Create(@TempDir & '\OCR_ImageResize.jpg') $miDoc^ ERROR Please help me Code: #include <Constants.au3> #include <ScreenCapture.au3> #Include <Misc.au3> #include <Array.au3> #include <GDIPlus.au3> $image = @MyDocumentsDir & "\aaa_teste.jpg" ConsoleWrite(OCR($image)) Func OCR($Image) Local $miDoc, $Doc Local $str Local $oWord Local $sArray[500] Local $as_Text = "" $miDoc = ObjCreate("MODI.Document") ConsoleWrite("ObjCreate - The error value is: " & @error & @CRLF) $miDoc.Create(@TempDir & '\OCR_ImageResize.jpg') ConsoleWrite("Create - The error value is: " & @error & @CRLF) $miDoc.Ocr(9, False, False) ConsoleWrite("Ocr - The error value is: " & @error & @CRLF) If $Error = False Then $i = 0 For $oWord in $miDoc.Images(0).Layout.Words $str = $str & $oWord.text & @CrLf ConsoleWrite($oWord.text & @CRLF) $sArray [$i] = $oWord.text $i += 1 Next $as_Text = _ArrayToString($sArray," ",0) $as_Text = StringReplace($as_Text, " ", "", 0) ElseIf $Error = True Then $Error = False EndIf $miDoc.Close(False) Return $as_Text EndFunc Func OCRGetModi($Image) Local $sArray[1], $oWord Local $miDoc = ObjCreate("MODI.Document") $miDoc.Create($Image) If @error Then Return SetError(1) $miDoc.Ocr(9, True, False) If @error Then Return SetError(2) For $oWord In $miDoc.Images(0).Layout.Words ReDim $sArray[UBound($sArray)+1] $sArray[UBound($sArray)-1] = $oWord.Text Next $sArray[0] = UBound($sArray)-1 Return $sArray EndFunc
×
×
  • Create New...