Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

drewc1138

macrumors 6502
Original poster
Jun 30, 2007
358
1
Not sure if this is the right place or not, but here goes.

I download a few videos using Transmission from time to time, and I watch them either on my iPhone or AppleTV. Right now, what I'm having to do is wait for them to finish and drag them over into VisualHub, which converts them and automatically adds them into iTunes after conversion.

I'd like to be able to automate this process somehow. I'd somehow like it to happen where, as soon as a file has completed downloading, it dumps over into VisualHub, where the file is converted, and then automatically imports into iTunes.

Does anyone have a similar script, or know of a direction I can head to find one?
 
I don't know the specifics but here are some starting points.

OSX provides a tool for checking if a file has changed called MAILCHECK.
When in the terminal try this:
MAIL=testfile
MAILCHECK=10

When the file named testfile is changed, you will get a notification in the terminal. Another method is to use the stat command to monitor an entire directory for changes.
E.g.
stat testdir
Gives an output similar to:
234881029 7966131 drwxr-xr-x 5 apl staff 0 170 "Sep 4 15:40:50 2005" "Sep 4 15:47:31 2005" "Sep 4 15:47:31 2005" 4096 0 0 testdir

As far as converting the video goes, you could either try to use automator to record your actions to convert with the program you are using. I use ffmpeg (you can find a version compiled for osx in the ffmpegX program) and use settings specifically for an iPod / iPhone - found here Link

Then all you would have to do is wrap these up in a shell script and you are good to go.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.