Automator命令行:“无法打开工作流程”


0

我在Automator中创建了一个工作流程,包括单个操作“Word文档的转换格式”(由Microsoft Word提供)。我保存了这个~/Documents/convert_word_to_pdf.app。我可以通过在这个应用程序上拖动一个word文件来运行它,它将为我生成一个PDF。但是,我无法弄清楚如何通过命令行运行它。我试着跑步automator convert_word_to_pdf.app foo.docx,我得到了Unable to open workflow.。我也试过convert_word_to_pdfconvert_word_to_pdf/document.wflow作为论据automator,得到了同样的结果。我在这里错过了什么?


而且~/Documents/convert_word_to_pdf.app foo.docx
Thomas Ayoub 2014年

那也不起作用:(
limp_chimp 2014年

那是什么错误?
Thomas Ayoub 2014年

Answers:


1

用途-i

automator -i foo.docx ~/Documents/convert_word_to_pdf.app

或者如果有多个参数:

printf %s\\n foo.docx bar.docx|automator -i - ~/Documents/convert_word_to_pdf.app

请参见手册页:

SYNOPSIS
     automator [-v] [-i input] [-D name=value ...] workflow

DESCRIPTION
     automator runs the specified workflow.  To create or edit a workflow, use
     the Automator application.

     The following options are available:

     -D name=value
              Set variable name to value for this run of workflow.

     -i input
              Set input as the input to workflow If input is - then the con-
              tents of standard input is used.  The newline character (\n) is
              the delimiter for multiple strings.

     -v       Run in verbose mode.

0

OSX上的捆绑包只是目录,因此要运行程序您必须调用可执行文件。它看起来像:

~/Documents/convert_word_to_pdf.app/Contents/MacOS/Application\ Stub path/to/foo.docx

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.