我有以下Applescript,它使用PDFpen来对文档进行光学字符识别。
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末尾的repeat块等待文档完成,然后脚本的其余部分才会继续。我似乎无法在rb-appscript中复制这部分逻辑。任何帮助都将不胜感激。
发布于 2013-03-05 08:47:29
我想通了。以下是生成的rb-appscript代码。
doc = @app.open MacTypes::Alias.path(file)
doc.ocr
while doc.performing_ocr.get
sleep 1
end
doc.close(:saving => :yes)https://stackoverflow.com/questions/15210666
复制相似问题