【问题标题】:automator enable/disable/delete action in run applescriptautomator 在运行 applescript 中启用/禁用/删除操作
【发布时间】:2011-11-19 00:10:39
【问题描述】:

我有一个带有Run Applescript 操作的自动化工作流程。是否可以在我的Run Applescript 中启用/禁用/删除另一个自动化操作? See my previous question for more details.

编辑:我已经开始赏金了。我正在寻找能够让我在 Automator 应用程序中执行此操作的问题。

【问题讨论】:

    标签: applescript automator


    【解决方案1】:

    我不知道在 Automator 应用程序 中执行此操作的方法,但请尝试一下 - 以下示例 workflow 中的脚本切换启用的属性其后的动作。使用 3 个操作创建一个新工作流:

    1) Ask for Text 操作以获得一些输入;

    2) 一个 Run AppleScript 动作来测试输入并做一些事情:

    on run {input, parameters}
    
        if (input as text) is "" then -- if no input then disable the following action
            set currentAction to index of current action of front workflow -- the most recent completed action
            tell Automator action index (currentAction + 2) of front workflow to set enabled to not enabled
        end if
    
        return input
    end run
    

    3) 一个 Ask for Confirmation 操作以建立一个对话框(或不建立)。

    您可以使用其他操作属性,例如名称,但如果有多个相同的操作,则索引或 ID 效果更好。

    【讨论】:

    • 如何按名称引用自动化操作?我已经尝试过:告诉 Automator 操作名称“新文本文件”的前端工作流将启用设置为启用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-12
    • 2015-01-12
    • 1970-01-01
    • 2022-01-16
    • 2021-12-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多