MPEG2 Export

I am hoping someone can offer up some help here. I have been struggling most of the evening trying to write a script that will allow me to batch export a number of QuickTime movies (about 60) as MPEG2 files (using the export plug-in that came with DVD Studio Pro). Below is the code I have “hacked” through without much luck. Any thoughts, suggestions, etc. would be greatly appreciated.



tell application “QuickTime Player”
open file “Macintosh HD:Users:dougwoodard:Desktop:Compression:Apple Script Test:Untitled 1”
if (can export movie “Untitled 1” as MPEG) is true then
set the new_file to “Untitled 1”
export movie 1 to “Macintosh HD:Users:dougwoodard:Desktop:Compression:Apple Script Test:MPEG Files:Untitled 1” as MPEG using settings preset “NTSC”
end if
close movie “Untitled 1” saving no
open file “Macintosh HD:Users:dougwoodard:Desktop:Compression:Apple Script Test:Untitled 2”
close movie “Untitled 2” saving no
open file “Macintosh HD:Users:dougwoodard:Desktop:Compression:Apple Script Test:Untitled 3”
close movie “Untitled 3” saving no
end tell

What happens when you run the script? Have you attempted to record a script to see an example of working code?

I did try recording a script – my jumping off point – but the recorder would not pick up the Export function in QT.

The current incarnation of the code hangs on the “export movie 1…” line with an error reding “QuickTime Player got an error: Can’t make some data into the expected type.”

On previous code I got an error that QuickTime didn’t understand the parameters. In addition, I had to modify the export from MPEG2 to MPEG to get the code past that point as well. I don’t think that is correct.

I don’t have the DVD plugin that you mentioned but if I have a movie open in QT Player and run this line (modified to use a local path), it works as expected. Note the addition of the word ‘file’ before the path.

export movie 1 to file "Macintosh HD:Users:dougwoodard:Desktop:Compression:Apple Script Test:MPEG Files:Untitled 1" as MPEG4

Tested with the OS X 10.2.6 and QuickTime 6.2.


Thanks a million! That was the missing part of the script.

Also, I had to remove " using settings preset “NTSC” " and then it worked flawlessly. You don’t know how happy you’ve just made us.

Have a great weekend.