0

I have the following Applescript that uses PDFpen to OCR a document.

tell application "PDFpenPro"
    open theFile as alias
    tell document 1
        ocr

        repeat while performing ocr
            delay 1
        end repeat
        delay 1
        close with saving
    end tell
end tell

The repeat block at the end waits for the document to finish before the rest of the script continues. I cannot seem to replicate this part of the logic in rb-appscript. Any help would be appreciated.

Joe Workman
  • 341
  • 1
  • 16

1 Answers1

0

I figured this out. Here is the resulting rb-appscript code.

    doc = @app.open MacTypes::Alias.path(file)
    doc.ocr

    while doc.performing_ocr.get
      sleep 1
    end
    doc.close(:saving => :yes)
Joe Workman
  • 341
  • 1
  • 16