Applescript application interface command line mplayer

Many high quality (e.g. 1080p) movies take significant system resources to play. A GUI wrapper application only adds an extra middle man. The command line version of mplayer is very fast and has served me well many times. I am a huge fan of the command line but sometimes I just want to double click or drag and drop.

You first need to install macports and then install mplayer by typing

$ sudo port install mplayer

Here Is what I threw together:

on open movies

    — Play each file in the list of files to open.
    repeat with movie in movies

        — Convert alias to conventional path.
        set moviepath to quoted form of ¬
            (POSIX path of (movie as Unicode text))

        — play the file with mplayer.
        set command to "/opt/local/bin/mplayer " & moviepath

        do shell script command

    end repeat

end open

Open the script in Script and save it as an Application. Unfortunately you can’t double click anything and open it with this but you can drag and drop as well as select open with.

Well it is not all that impressive but for large movie file you can’t beat mplayer on the command line.

One thought on “Applescript application interface command line mplayer

  1. Copied and pasted into script editor, the AppleScript quoted on this page will not run. At some point during your publishing process, the “–“s used to denote comments got converted into “–”s.

    Otherwise, extremely helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *