1
votes

I've cobbled together an After Effects render farm which outputs image sequences. I have a series of Automator workflows (which are currently run as apps) that convert these frames into video using FFMPEG.

It works great, but I need over half a dozen different workflows – one for each major framerate (24fps, 25fps, 30fps, etc, and a duplicate of each of those that creates video with audio if the original source folder contains an audio file.

I'm fine with having so many workflows, but I'd like to consolidate my exported apps into one master Automator app that simply asks what frame rate I want (from a list) and then takes that choice and runs the specific workflow (or app) associated with that choice.

At the minute, I've adapted a 'Run AppleSript' action which I found on on Stack Overflow. I'm starting small and testing it with a few frame rates…

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

It 'works', in terms of it asking me the correct questions, but I'm not really sure where I go from here. I think I need to pass the answer into a variable and use that to make a selection in the Run Workflow action (or Launch Application, seeing as how my workflows are also apps?), but I don't know how.

Any help would be appreciated.

2
If each of the list items are the actual names of the apps, then all you need after the choose from list command is if not result is equal to false then activate application (result as string) and it will open the selected app. It also doesn't need to be an Automator app that has these two commands, it could be an AppleScript app.user3439894
@user3439894 Perfect. Yes these are the names of my apps, so I've made an Apple Script as you suggested. Such a simple and elegant solution. Thanks!markpaterson
As you've chosen to use the info in my first comment, I've added it as an answer. I would appreciate you marking it as the accepted answer, if you so choose.user3439894
@user3439894 thanks! I was hoping you would do that so I could give you correct credit.markpaterson

2 Answers

1
votes

If each of the list items are the actual names of the apps, then all you need after the choose from list command is:

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

This will open the selected app.

It also doesn't need to be an Automator app, it could be an AppleScript app that has just these two commands:

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)
1
votes

This AppleScript code may work for you

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" to activate
else if theChoice is "ProRes 24 with Audio" then
    tell application "workflow 2" to activate
else if theChoice is "ProRes 30" then
    tell application "workflow 3" to activate
else if theChoice is "ProRes 30 with Audio" then
    tell application "workflow 4" to activate
end if

Then just insert the correct Automator application names, replacing these... "workflow 1" etc