Skip to content

Instantly share code, notes, and snippets.

@pajp
Created November 20, 2011 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pajp/1380682 to your computer and use it in GitHub Desktop.
Save pajp/1380682 to your computer and use it in GitHub Desktop.
Encode mkv files to Apple TV format and add them to iTunes
# Moved here: https://github.com/pajp/add-to-itunes
@stisti
Copy link

stisti commented Nov 20, 2011

Why the timeout on line 25? Otherwise it looks great. Code review passed :)

@stisti
Copy link

stisti commented Nov 20, 2011

Hmm... If you added the timeout because osascript complains if iTunes takes too long to answer, consider using "ignoring application responses" block around the tell.

@stisti
Copy link

stisti commented Nov 20, 2011

And one more thing: when processing command line arguments with a for loop, just "for f; do" is enough.

@pajp
Copy link
Author

pajp commented Nov 21, 2011

Thanks for the comments!

Yes, the timeout is there because the default timeout of 2 seconds (or so) is not enough since my iTunes is configured to copy the added file to the iTunes media library (1080p content often weighs in on a gigabyte or two). And if I googled properly "ignoring application responses" would make the add return immediately. However, I actually want it to block until the media has been added so that I can safely rm it afterwards. But please do correct me if I'm wrong. :-)

@stisti
Copy link

stisti commented Nov 21, 2011

No, you're right. I don't know of a good way around that. Probably best the way you did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment