Droplet with a progress bar

applescriptautomationencodingterminal

First of all, apologies for my ignorance on the subject. All of this ffmpeg and automation is new for me and sometimes I cannot see even evident things.

I am learning command lines to encode videos (I use FFMPEG to change settings of the video, watermark, all this sort of things to improve my workflow)

Now I am trying to transform those command lines in to Applescript droplets apps to make life easier. Last night I managed to turn my first one in an Applescript app droplet but I am missing the progress which I can see when I use the command shell.

I.E.

I can see frames per second, how much inside de video … this sort of info

progress I can see if using the script on terminal window

I would like to know if there is a way to modify / add something on this script to see similar progress, either tell terminal to open while executing the script or a detailed progress bar pop up.

This is the scrip I am currently starting with

for f in "$@"
do

/usr/local/bin/ffmpeg -i "$f" -vf "drawtext=fontfile=/Library/Fonts/Tahoma.ttf: text='Central Text':\ x=(w-text_w)/2:y=(h-text_h-line_h)/2: fontsize=100: fontcolor=white@0.2" -s 720x406 -c:v libx264 -b:v 1400k -pix_fmt yuv420p -b:a 192k "${f%.*}_watermarked.mov"
done

Best Answer

If you want to just have terminal open and run you can get an idea from below.

It is not very neat but works of sorts..

example:

on open myFiles
        set bigList to {}
        repeat with i from 1 to number of items in myFiles
            set this_item to item i of myFiles
            copy (quoted form of POSIX path of this_item) & space to end of bigList
        end repeat
     tell application "Terminal"


            do script ("for f in  " & items of bigList as string) & "
    do

    echo  \"$f\"

    done"

        end tell
end open