-
-
Save pajp/1380682 to your computer and use it in GitHub Desktop.
# Moved here: https://github.com/pajp/add-to-itunes |
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.
And one more thing: when processing command line arguments with a for loop, just "for f; do" is enough.
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. :-)
No, you're right. I don't know of a good way around that. Probably best the way you did it.
Why the timeout on line 25? Otherwise it looks great. Code review passed :)