2013-03-04 85 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)