gpt4 book ai didi

applescript - automator 在运行 applescript 中启用/禁用/删除操作

转载 作者:行者123 更新时间:2023-12-04 06:07:51 25 4
gpt4 key购买 nike

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

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

最佳答案

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

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

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

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 效果更好。

关于applescript - automator 在运行 applescript 中启用/禁用/删除操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8140149/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com