Automator:我想询问选项列表,然后根据我做出的选择运行特定的工作流程

问题描述 投票:0回答:2

我将输出图像序列的After Effects渲染场拼凑在一起。我有一系列的Automator工作流程(当前作为应用程序运行),它们使用FFMPEG将这些帧转换为视频。

[效果很好,但是我需要超过六个不同的工作流程-每个主要帧速率(24fps,25fps,30fps等),如果原始来源,则每个创建视频with audio的副本都重复一个。文件夹包含一个音频文件。

我对拥有如此多的工作流程感到满意,但我想将导出的应用程序整合到一个主Automator应用程序中,该应用程序简单地询问我想要的帧速率(从列表中),然后选择该选项并运行特定的工作流程(或应用)与此选择相关联。

此刻,我改编了我在Stack Overflow上发现的'Run AppleSript'操作。我从小处开始,并以几种帧速率对其进行测试...

on run {input, parameters}

    choose from list {"ProRes 24", "ProRes 24 with Audio", "ProRes 30", "ProRes 30 with Audio"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
    return the result as string

    return input
end run

就它问我正确的问题而言,它“有效”,但是我不确定我从这里到哪里去。我想我需要将答案传递到变量中,然后使用该变量在“运行工作流”操作中进行选择(或启动应用程序,以查看我的工作流同时还是应用程序?),但我不知道如何。

任何帮助将不胜感激。

applescript automator
2个回答
0
投票

此AppleScript代码可能对您有用

set theChoice to (choose from list {"ProRes 24", "ProRes 24 with Audio", "ProRes 30", "ProRes 30 with Audio"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed) as text

if theChoice is "ProRes 24" then
    tell application "workflow 1.app" to open
else if theChoice is "ProRes 24 with Audio" then
    tell application "workflow 2.app" to open
else if theChoice is "ProRes 30" then
    tell application "workflow 3.app" to open
else if theChoice is "ProRes 30 with Audio" then
    tell application "workflow 4.app" to open
end if

然后只需插入正确的Automator应用程序名称,替换这些...“工作流程1.app”等


0
投票

如果每个列表项是应用程序的实际名称,则在choose from list 命令之后您需要做的就是:

if not result is equal to false then activate application (result as string)

这将打开所选的应用程序。

它也不必是Automator应用程序,它可以是仅具有这两个commands:的AppleScript

应用程序
choose from list {"ProRes 24", "ProRes 24 with Audio", "ProRes 30", "ProRes 30 with Audio"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
if not result is equal to false then activate application (result as string)
© www.soinside.com 2019 - 2024. All rights reserved.