【问题标题】:How to translate this Applescript into rb-appscript?如何将此 Applescript 翻译成 rb-appscript?
【发布时间】:2013-03-05 08:47:28
【问题描述】:

我有以下使用 PDFpen 对文档进行 OCR 的 Applescript。

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 中复制这部分逻辑。任何帮助,将不胜感激。

【问题讨论】:

    标签: applescript rb-appscript


    【解决方案1】:

    我想通了。这是生成的 rb-appscript 代码。

        doc = @app.open MacTypes::Alias.path(file)
        doc.ocr
    
        while doc.performing_ocr.get
          sleep 1
        end
        doc.close(:saving => :yes)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 2020-12-01
      • 2017-07-24
      相关资源
      最近更新 更多