I use Automator together with ffmpeg which works great. A shell script command is run with two parameters:
- -ss 00:00:00 (starting)
- -t 00:00:00 (time length)
Q: Is it possible to set the two parameters using a popup window?
applescriptautomationautomatorbashcommand line
Best Answer
You asked "Is it possible to set the two parameters using a popup window?" and the answer to that is yes.
Here is one example of how it could be done:
In between the Ask for Finder Items action and the Run Shell Script action add a Run AppleScript action with the following AppleScript code:
Then in the Run Shell Script action, change the script to the following code:
How this works:
The Ask for Finder Items action passes a
list
of filesystem objects to the next action.The Run AppleScript action uses a
display dialog
to add the start time and length to the beginning of thelist
passed to it from the Ask of Finder Items action.The Run Shell Script action receives what was returned from the Run AppleScript action, in this case the value of
return input
as alist
in which its firstitem
is thetext returned
from theresult
of thedisplay dialog
, being the start time and length. This gets set to thestart_time_and_length
variable and thenshift
is used to remove it from thelist
that gets passed tofor f in "$@"
to process the remainingitems
in thelist
.Note: If you have a issue using the AppleScript code, shown above, then you could use the following as a workaround: