Alfred Tip: Convert files to an Apple Tv compatible format

Don from dirtdon.com recently lured my interest in shell scripts that makes sense to use from Alfreds actions menu. He did so by writing an amazing article with some of favorite bash scripts, that he had made specifically for Alfred. He had a fantastic script for converting video files to an Apple Tv friendly format, that I saw great potential in. I therefore tried to get the script up and running on my own machine, and in the process of doing so, I found a bug in his script. I fixed it and told him about my fix.

I have been adding some functionality to script since then, but it really took of when I contacted Don the second time. I contacted him in the search of help, I had an idea for a way to implement a progress indicator right in to Alfred, and I knew how I would implement it, but I didn’t know how to write the code. Don helped me out, and wrote the code for me. And by the help of our combined efforts we have made a working script, that in my opinion works quite well.

The script has the following feature set:

  • Growl notifications
  • Status updater (it shows queue data, ETA’s and percentage of completion).
  • Queue support
  • And removal of the old files

I’m posting this version of the script on my own site, since Don and I don’t share the need for the same feature set, so mine has some added functionality.

I hope I will inspire you as much as Don inspired me!

#Update Alfred has added support for a new extension format called… oh you guessed it .alfredextension so I thought I would update the script. As i bonus all you have to get this working on you machine now is to downlaod the script and double click it:-)

If you haven’t heard of Alfred before, go checkout his website

15 thoughts on “Alfred Tip: Convert files to an Apple Tv compatible format

  1. Hi, i can’t get it working. i downloaded the Handbrke CLI …

    Can you give a more detailed instruction?

    Where does the files from the handbrake DMG go?
    Do i need to change something in the Script itself?

    Thanks for your help!

  2. hi Andreas.
    I found a distraction in your Script.sh.
    it tries to write to a log file
    /Users/Andreas/Library/Logs/HandbrakeCLI.log
    of course it yealds a “No such file or directory”.
    trying to just comment out the code that writes to the logs didn’t seem to work, and even adding my own log files (manually copied to the script folder and given 777) has no effect.
    now I have

    LOG=”/Users/ubi/Library/Logs/HandbrakeCLI.log”
    LOG2=”/Users/ubi/Library/Logs/HandbrakeCLI_Converted.log”

    and if I run the script I get

    Aria:TranscodeforAppleTv ubi$ ./Script.sh ~/Downloads/Video/test_convert.avi
    ./Script.sh: line 32: /Users/ubi/Library/Application: No such file or directory
    2011-09-24 09:41:44.564 defaults[9823:903]
    The domain/default pair of (/Users/ubi/Library/Application, Support/Alfred/extensions/scripts/TranscodeforAppleTv/info) does not exist
    2011-09-24 09:41:44.615 defaults[9828:903] Unexpected argument ; leaving defaults unchanged.
    rm: HandbrakeCLI.log: No such file or directory
    rm: HandbrakeCLI_Converted.log: No such file or directory
    Your video has been transcoded to AppleTV format.

    what do you think it is related to?
    thanks
    ubi

    • I have fixed and updated the plugin. Would you please redownload it and tell if it works. BTW in my experience the plugin only works if you check the silent setting in Alfred.

    • Theoretically this gist I just made should work https://gist.github.com/1270471 :)

      I haven’t tried it, but as you can see on line 34 I changed the output folder to be ~/Music/iTunes/iTunes Media/Automatically Add to iTunes.localized/ I think this will work.

      If you don’t know what to use the gist for, heres a brief how to.

      1. Open the alfred settingsfolder, locate the “TranscodeforAppleTv” folder, and open the file called “Script.sh”.
      2. Copy all the text in the gist (https://gist.github.com/1270471) and replace the text in “Script.sh” with it.
      3. Try and see if it is working :) if not, come back and I will see what I can do.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>