【问题标题】:Mac Automator conditional workflowsMac Automator 条件工作流程
【发布时间】:2014-06-04 14:24:54
【问题描述】:

我对 Mac 上的 Automator 还是很陌生。我正在尝试使用它为 Unity 制作项目模板创建者。目前我的工作流有一个模板项目文件夹,复制它并允许它被重命名,然后将在 Unity 中自动运行新项目。

我希望它弹出一些复选框以进一步自定义模板。这些复选框将删除/添加额外的包到项目的东西,如 Vuforia、NGUI 等。

我不确定如何在 Automator 中执行复选框或条件工作流。

【问题讨论】:

    标签: macos automator


    【解决方案1】:

    我会添加一个“运行 Applescript”操作,询问您想要哪些选项,然后构建可选安装列表(假设每个选项都是一个文件夹路径),然后您可以将该列表从操作中传递出去并返回到工作流,复制每个文件夹。您也可以在 Applescript 中进行构建,这正是 AS 的设计目的。 比如:

    set theOptions to {"Vuforia", "NGUI", "Other"}
    set theChoices to choose from list theOptions with prompt "Select the options you'd like installed." with multiple selections allowed
    
    set installItems to {}
    if theChoices contains "Vuforia" then set installItems to installItems & vuforiaPath
    if theChoices contains "NGUI" then set installItems to installItems & NGUIPath
    if theChoices contains "Other" then set installItems to installItems & OtherPath
    return installItems
    

    如果安装不仅仅是“还包括”的路径列表,您的 if 语句可能必须包含更多内容。这只是试图让您尽快退出 AS 并返回 Automator。您可以在 Automator 中调出对话框、保存到变量、调出另一个等,但它很笨重。

    【讨论】:

      猜你喜欢
      • 2015-08-13
      • 2013-10-06
      • 2010-11-04
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 2020-12-26
      相关资源
      最近更新 更多