climberman Posted June 30, 2008 Posted June 30, 2008 Hey I'm having some trouble. The first error I got for undeclared variables and found them in here after running the check $Viewer = GUICreate ( "Embedded MODI Viewer", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2 , _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) I added Dim statements so at least it would run and it did. It read the file too which was excellent but here's the problem. It froze when it opened the modi window and i had to force quit that window so that the results would pop up. Did something go wrong with the autoit installation with those variables missing or something like that? Maybe a better question is what the WS_ variables are All help is appreciated. I'm running Vista i that makes a difference, Office 2003.
ptrex Posted June 30, 2008 Author Posted June 30, 2008 @climbermanMaybe if you add #include <WindowsConstants.au3>This might get you goingregardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
climberman Posted June 30, 2008 Posted June 30, 2008 @climberman Maybe if you add This might get you going regards ptrex Yes that absolutely did the trick. AutoIt is a bit different than what im used to pragramming mathematical stuff but your posts are very helpful. If I'd read up on the function maybe I would've caught that mistake. Anyways, I threw in my own twist as a test to capture a window and it worked with your script. I downloade a vista sidebar gadget to see my mouse coordinates since I can't think of a good way to see that on the fly without writing something myself and taking way too long to get it to work. I plan to replace my addition with a specific region screen capture. After seeing the offshoot with minicap.exe, this way seems much better, plus the minicap thing didn't work for me. so thx ptrex and here's some code for anyone else interested. ;Wait for the window so that we capture it $sTargetImage = "C:\Users\Brian\Desktop\OCR_tgt.jpg" $sTargetTitle = "Untitled - Notepad" WinWaitActive( $sTargetTitle ) _ScreenCapture_CaptureWnd($sTargetImage, WinGetHandle($sTargetTitle)) The built in screen capture function needs to be included. O and the mouse can be turned off but i didn't bother since this was a test
C2C Posted July 1, 2008 Posted July 1, 2008 Can anybody confirm this working on Vista Ultimate x86 with Office 2007 ? ----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win
Markos Posted July 6, 2008 Posted July 6, 2008 Just spent half a day on getting this to work. So for ppl having the same problems as me: #1: doesn't work on x64 v. of autoit -> use either unicode or ANSI v. of autoit #2: When I installed my Office 2007 I unchecked some features of it. When I used full instalation, this started to work.
Skrip Posted July 7, 2008 Posted July 7, 2008 Does not work on Office 2007. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]
duckling78 Posted August 7, 2008 Posted August 7, 2008 Func OCR_Region($x,$y,$width,$height)oÝ÷ ØZèÚòx-+ºw-èºÙÉ·êZ©µêïj¸nW¬².ÖÞ²¶§X¤zØb²)ìµæjëh×6Func OCR_Region($left,$top,$right,$bottom) The "$width" and "$height" does not seem to be correct when testing this function out with Office 2003 SP3 installed. Sorry if this was already covered somewhere. Thanks for the functionality!
climberman Posted August 8, 2008 Posted August 8, 2008 So far I've been having great success with this, but now have encountered a strange problem. I have the OCR in several different functions. The first time, it executes with a certain file just fine and exits the function. The next time, it uses a different image just fine but in a seperate function and the exits the function. The third time, it goes back into the same function and whether it reads a different file or not, the OCR fails, even if it was the same image as before but only renamed. I tried throwing in a close statement to the document but it didn't give a fix. Any ideas?
Michel Claveau Posted August 8, 2008 Posted August 8, 2008 (edited) Hi, Firestorm! You said:Does not work on Office 2007.But, on my Vista-Ultimate + MS-Office-2007, it work OK. Edited August 8, 2008 by Michel Claveau
climberman Posted August 8, 2008 Posted August 8, 2008 So far I've been having great success with this, but now have encountered a strange problem.I have the OCR in several different functions.The first time, it executes with a certain file just fine and exits the function.The next time, it uses a different image just fine but in a seperate function and the exits the function.The third time, it goes back into the same function and whether it reads a different file or not, the OCR fails, even if it was the same image as before but only renamed.I tried throwing in a close statement to the document but it didn't give a fix.Any ideas?Sorry for this earlier post, I just cleaned up some of the code that seemed like extra junk and it took care of the problem.
Sand Posted August 18, 2008 Posted August 18, 2008 (edited) Hello it's just me or when i give a small areas to OCR i get COM Error ? for example OCR_Region (19,619,49,707) and i get the COM Error is this normal ? Here is my function Func OCR_Region($x,$y,$x1,$y1) Const $miLANG_ENGLISH = 9 $file_name = "C:\VRT_Temp.png" _GDIPlus_Startup () _ScreenCapture_Capture ($file_name, $x,$y, $x1,$y1, False) Dim $miDoc = ObjCreate("MODI.Document") $miDoc.Create($file_name) $miDoc.Ocr($miLANG_ENGLISH, True, True) Dim $str = $miDoc.Images(0).Layout.Text FileDelete($file_name) _GDIPlus_ShutDown () Return $str EndFunc Edited August 18, 2008 by Sand
APPLEEATER Posted August 31, 2008 Posted August 31, 2008 Is it possible just to get the ORC part of office? because i do not want to have to install Microsoft Office to use this... thanks
ptrex Posted September 1, 2008 Author Posted September 1, 2008 @APPLEEATER I don't think this is possible ? Maybe you can try to install Office Web Components only and test if it is included in that ? @zhuzb Thanks Regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ofLight Posted September 3, 2008 Posted September 3, 2008 (edited) @APPLEEATERI mainly use this OCR within VM's, and dont want the overhead of Office on every instance. So i just install MODI. You can just download the Microsoft Office Document Imageing from MSDN, im not sure if this is the exact link for wuttever OS you use. MSDN LINKEDIT: wrong link, lemme see if i can find the one where i downloaded mine.EDIT2: I think Ptrex is correct, you cant download it through MSDN seperate anymore??? or atleast I cant seem to find the install package, only the reference. I have looked through my backups and found the .dll's I was installing, the main one I think you want is MDIVWCTL.DLL. Edited September 3, 2008 by ofLight There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly
LinuZ Posted September 3, 2008 Posted September 3, 2008 Is there no way to do this without any programs that cost?
ovideo Posted September 12, 2008 Posted September 12, 2008 oh hi. great work on this, ptrex, it will be very useful to me. @ofLight: do you mean this works without office installed? just with modi2003.exe installed? i'll try removing office to verify this. btw if anyone has trouble getting modi2003.exe i can upload it somewhere, unless i'm not allowed to (haven't actually READ the eula, lol)
BotWriter Posted November 1, 2008 Posted November 1, 2008 oh hi. great work on this, ptrex, it will be very useful to me.@ofLight: do you mean this works without office installed? just with modi2003.exe installed? i'll try removing office to verify this.btw if anyone has trouble getting modi2003.exe i can upload it somewhere, unless i'm not allowed to (haven't actually READ the eula, lol)It is available to download from Microsoft at modi2003.exe download.BotWriter
S0789300 Posted January 8, 2009 Posted January 8, 2009 I hope Ptrex et al. are still willing to answer questions regarding this script... I see that a lot of people are having success with it which makes me feel great! I however, am getting COM errors and believe I have checked everything that others have said. I have created a .tiff and placed it in C:\Temp\MyPic.tiff I have objects in the C:\Program Files\Common Files\Microsoft Shared\MODI\12.0\ -- specifically 30 files, including dll's for a total of 6.7 MB, no M*.dll though I am getting a rough total of 9 COM errors, and an error when closing the MODI window. I have taken a screenshot of the sorts of COM errors I am getting and hope someone can point in my in the right direction. I have office 2007, and have also tried downloading the '03 MODI executable. It dumps 2 files, one HTML file and one CHM file so I am unsure if that is the way to go - regardless I do have the 2007 MODI objects as stated above. Could anyone lend assistence? I would love to be able to use Ptrex source and maybe even the minicap dumps provided by trids. You guys are great, any help would be greatly appreciated. Cheers. PS: I could be missing something totally stupid-simple, so please dont hold it against me
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now