2013-03-04 6 views
0

PDFpen을 사용하여 문서를 OCR 처리하는 다음 AppleScript가 있습니다.이 Applescript를 rb-appscript로 번역하는 방법?

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 

끝에있는 반복 블록은 나머지 스크립트가 계속되기 전에 문서가 완료 될 때까지 기다립니다. 나는 rb-appscript에서이 부분을 복제 할 수 없다. 어떤 도움을 주시면 감사하겠습니다.

답변

0

나는 이것을 알아 냈다. 그 결과 rb-appscript 코드가 있습니다.

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

    while doc.performing_ocr.get 
     sleep 1 
    end 
    doc.close(:saving => :yes)