🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.acrobat.capture
Article #192

Re: How to start PaperCapture by batch-script

#192
From: Lauren_Sandbek
Date: Tue, 27 Jun 2006 16:37
56 lines
3313 bytes
Andreas -

This is great work! I've been learning AutoHotKey and have been very impressed with its abilities. I've utilized this script with Adobe Pro 7.08 and it's rather successful - most of the time.

So now I have a question =). I've run into issues with getting the save functionality to work consistently. Sometimes "Send ^s" works like a charm and sometime it appears to never occur (although the log file says it did). The loop will just hang until I hit CTRL+S manually. Then the loop continues processing the documents. This happens inconsistently on the same 4 TIF files. Only two of the four files might be successful the first time I run the script, but the second time, all 4 will render. I thought perhaps the program was executing the steps too quickly at times, but I've run it on a slower machine and put some "sleep" commands in place and haven't been able to rectify the problem. Have you noticed this?

I'm including your code (that I've altered to suit me) below.

A little background: I am opening TIF files, in one folder, looping through them, doing the OCR and saving them to another folder as a PDF. I've set Adobe Acrobat 7 Pro as the default program for TIF files.

I appreciate any help you can provide in advance!

Lauren Sandbek

#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 Tools menu
Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{RIGHT}{ENTER} ;point to PaperCapture in the Tools-Menu
WinWait, Recognize Text

Send {UP}{ENTER} ;all pages
WinWait, Adobe Acrobat Professional - [%OutFilePDF%],,10

Send ^s ;send save keystroke (ctrl+s)
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
Technical Details
Message-ID: <3bbe7163.4@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing
References: <3bbe7163.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f84b4,2fc9ebfcfbdfca2f,start
X-Google-Attributes: gidf84b4,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Lauren_Sandbek@adobeforums.com
Newsgroups: adobe.acrobat.capture
Subject: Re: How to start PaperCapture by batch-script
Message-ID: <3bbe7163.4@webcrossing.la2eafNXanI>
Date: Tue, 27 Jun 2006 09:37:29 -0700
References: <3bbe7163.-1@webcrossing.la2eafNXanI>
Lines: 75
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing