The scripts below work for me, using Mac OS 10.4.11 and QuickTime Pro v. 7.6.4.
Note that my version of AppleScript (v. 2.1.1) doesn't recognize application QuickTime Player 7. Hence, application "QuickTime Player" was used throughout. Your needs may vary; if you can or must use the "7" by all means do so.
The first is based on the script Craig Williams posted in this thread: http://macscripter.net/viewtopic.php?id=31674 (in post #6). I modified the script a bit so that a new file is created on the front end, and the merged file gets written to it once the script finishes:
set file_name to text returned of (display dialog "A new merged QuickTime file will be created on the desktop. Please choose a name:" default answer "Enter Name")
tellapplication "Finder"
try
setmake_filetomakenewfileat (path todesktop folderasstring) with properties {name:file_name & ".mov"}
setnew_filetomake_fileasalias
onerror
display dialog "A file with the name " & "“" & file_name & "”" & " already exists on the desktop. Please try again." buttons {"OK"} default button 1 cancel button 1 with icon stop
endtry
endtell
settheCountto 1
set theFolder to choose folder with prompt "Choose the folder with QuickTime files you want to join together."
tellapplication "Finder"
settheFilestoeveryfileoffoldertheFolder
settotalFilesto (countthetheFiles)
repeatwithifrom 1 tototalFiles --to 1 by -1
setthisfiletoitemioftheFilesasalias
--QT Pro
mymergeFilesUsingQT(thisfile, theCount, totalFiles)
settheCounttotheCount + 1
endrepeat
endtell
delay 1
tell application "QuickTime Player"
telldocument 1
rewind
delay 0.5
saveasself containedinnew_file
close
endtell
endtell
onmergeFilesUsingQT(thisfile, theCount, totalFiles)
tell application "QuickTime Player"
activate
--the first file only gets copied
if theCount = 1 then
openthisfile
delay 0.5
telldocument 1
select all
copy
endtell
closedocument 1 savingno
else
--these files get the previous file added to it and
--then it is copied to be added to the next file
openthisfile
delay 1
telldocument 1
setxtogetduration
setcurrent timetox
paste
select all
copy
endtell
endif
endtell
endmergeFilesUsingQT
My own version, below, creates a new file and then opens a temporary QuickTime document to which each file is copied in turn. Once copying is complete, the temporary file is written to the file that was created at the beginning of the script:
set file_name to text returned of (display dialog "A new merged QuickTime file will be created on the desktop. Please choose a name:" default answer "Enter Name")
tellapplication "Finder"
try
setmake_filetomakenewfileat (path todesktop folderasstring) with properties {name:file_name & ".mov"}
setnew_filetomake_fileasalias
onerror
display dialog "A file with the name " & "“" & file_name & "”" & " already exists on the desktop. Please try again." buttons {"OK"} default button 1 cancel button 1 with icon stop
endtry
endtell
tell application "QuickTime Player"
settemp_doctomakenewdocument
endtell
set fol to choose folder with prompt "Choose the folder containing QuickTime files to be merged:"
tellapplication "Finder"
setthe_filestoeveryfileoffolderfol
repeatwithifrom 1 tocountofthe_files
seta_filetoitemiofthe_files
mymerge_files(a_file, temp_doc)
endrepeat
endtell
delay 1
tell application "QuickTime Player"
telldocument 1
select none
saveasself containedinnew_file
close
endtell
endtell
onmerge_files(a_file, temp_doc)
tell application "QuickTime Player"
activate
makenewdocument
opena_file
delay 1
telldocument 1
setttogetduration
setcurrent timetot
select all
copy
close
endtell
activatedocumenttemp_doc
delay 1
telldocument 1
paste
endtell
endtell
endmerge_files
Hope this helps. Good luck.