I'm attempting to automate the OCR (optical character recognition) process in Adobe 7.08 Professional (reference http://www.adobeforu.../webx/.3bbe7163 if you'd like more information).
I'm using Acrobat and AutoHotKey to migrate TIF files from one folder to another location where I save them as PDFs and OCR the text. Everything is working beautifully, except sometimes my AHK loop doesnt appear to execute the line:
Send ^s ;send save keystroke (ctrl+s)
The AHK log file says it has executed, but the save window never opens. If I manually hit CTRL S on my keyboard, the loop continues processing the file and moves on to the next one.
My problem is that this doesn't happen every time I run the script. I have a set of 4 TIF files that I'm processing and the AHK loop hangs on different ones at the "send ^s" line. Occaisionally it runs through all of them without issue. I really want to install this script on a server and not have to monitor it.
I thought the commands might be happening too quickly so I've tried using Sleep functions and WinWait functions, but I've had no luck.
Any help you can provide would be greatly appreciated!

The code I'm using (I know its a little lengthy) is below:
#a:: ;;OCR Process UnScannedPath=C:\OCR_Analysis\NoOCR\*.tif ;set this variable to your unscanned pdf's ScannedPath=C:\OCR_Analysis\OCR\ ;set this variable to the dir of your scanned pdf's MsgBox,4, ,Unscanned files expected in %UnscannedPath%`nResults will be in %ScannedPath%`nDid you choose the appropriate language for OCR? IfMsgBox, No, Exit Loop,%UnScannedPath%, , 1 ;Recurse into subfolders. { StringSplit,OutFile,A_LoopFileFullPath,\ ;extract filename StringLeft, OutFilePDF, OutFile4, StrLen(OutFile4) - 3 OutFilePDF=%OutFilePDF%pdf FileDelete,%ScannedPath%%OutFilePDF% ;delete file, if it exists Run %A_LoopFileFullPath% ;start Adobe with the requested file winwait,Adobe Send, !f ;switch to Files Menu (in German Alt+d=Datei) ;use !f in the English version of Acrobat (Alt+f=Files) Send, {RIGHT}{RIGHT}{RIGHT}{RIGHT} ;point to Document menu Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{RIGHT}{ENTER} ;point to Recognize Text Using OCR/Start on the Document Menu WinWait, Recognize Text Send {UP}{ENTER} ;all pages WinWait, Adobe Acrobat Professional - [%OutFilePDF%],,10 Send ^s ;send save keystroke (ctrl+s) THIS IS THE PROBLEM LINE WinWaitActive, Save As Send %ScannedPath%%OutFilePDF%{ENTER} ;send output filename Send ^q ;close Adobe WinWaitClose, Adobe Acrobat Professional - [%OutFilePDF%] ;wait until Adobe is closed and start with the next pdf } msgbox PaperCapture done! return