batch export for quicktime pro

I recently got paid to write a short batch processing AppleScript that processed video via QuickTime Pro. It was harder than I initially thought it would be — the syntax of AppleScript is in turns wildly lax and highly specific. So it was kind of a pain, but just so nobody else has to fumble through QuickTime’s AppleScript dictionary, I’ll give the code away for free. Just cut and paste this into Script Editor:
with timeout of 86400 seconds
display dialog “Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop.” with icon note
tell application “Finder”
set the startup_disk to the name of the startup disk
end tell
set user to do shell script “whoami”
set input_folder_name to “Input”
set input_folder to startup_disk & “:Users:” & user & “:Desktop:” & input_folder_name & “:”
set user_desktop to startup_disk & “:Users:” & user & “:Desktop:”
set output_folder to startup_disk & “:Users:” & user & “:Desktop:Output:”
set file_extension to “_export.mp4″
try
tell application “Finder”
make new folder at user_desktop with properties {name:”Output”}
end tell
end try
try
set the_folder_list to list folder input_folder without invisibles
repeat with x from 1 to count of the_folder_list
set the_file to input_folder & item x of the_folder_list
set output_file to output_folder & item x of the_folder_list & file_extension
tell application “QuickTime Player”
activate
open the_file
export front document to output_file as MPEG4 using most recent settings with replacing
close front document
end tell
end repeat
on error
display dialog “This script requires a folder named ‘” & input_folder_name & “‘ located on the desktop.” with icon stop
end try
beep
end timeout
May 24th, 2008 at 3:26 pm
Ha! Fainting goat!
June 18th, 2008 at 9:12 pm
July 22nd, 2008 at 5:53 am
Hi, I was thinking here, I know anything about Applescript, but I wish to ask you if we could change the line “set input_folder_name to “Input”” to something that ask me WHERE is my input folder? The same for the output. Or, could we change the line of the script whenever we need and depending of our needs?
All the best and thanks for the gift!
Sorry about my poor english…
July 22nd, 2008 at 6:21 am
I found a freeware software (based on applescript too) on Version Tracker: http://www.versiontracker.com/dyn/moreinfo/macosx/18159
But there is a problem with the script. It works fine, but shows an error message all of the time (I dont know what it means), and quicktime starts to ask for attention everytime it opens a new file listed on the batch. It seems to be a little problem to be solved in some of the next versions.