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

4 Responses to “batch export for quicktime pro”

  1. Joshua Says:

    Ha! Fainting goat!

  2. BlogNetNews.com » PioneerValleyMA » ldopa.net » batch export for quicktime pro Says:

    Kramer auto Pingback[...] batch export for quicktime pro Number of comments: 1I 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 [...] Share | Rate | Permalink [...]

  3. Alfredo Says:

    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…

  4. Alfredo Says:

    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.

Leave a Reply