Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Concatenate Quicktime movies via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Concatenate Quicktime movies via AppleScript
Authored by: Westacular on May 31, '07 06:35:09PM
I modified this script to

1) be used as a context menu item in Finder (create a new Automator workflow with the Run AppleScript, cut and paste this into the box, and then Save As Plugin for Finder)

2) mark each of the files as a distinct chapter, to make it easy to jump to the start of each file

The code:


on run {input, parameters}
	tell application "Finder" to set input 
		to sort input by name
	repeat with i from 1 to the count of input
		set this_item to (item i of input)
		tell application "QuickTime Player"
			if i is equal to 1 then
				make new movie
			end if
			open this_item
			tell movie 1
				rewind
				select all
				copy
				select none
			end tell
			close movie 1 saving no
			tell movie 1
				add
				select none
				if i is equal to 1 then
					set this_track to make new track at beginning with data "Chapter 1"
					set enabled of this_track to false
					set the name of this_track to "Chapter Track"
					set chapterlist of track 1 to track "Chapter Track"
					set the movie_length to the duration
					tell chapter 1
						set the time to 0
						set the duration to movie_length
					end tell
				else
					set the newmovielength to the duration
					set the duration of this_track to newmovielength
					set the chapter_list to the name of every chapter
					set the new_chapter_list to chapter_list & (i as string)
					set the contents of the current chapter track to the new_chapter_list
					set the time of chapter i to movie_length
					set the duration of chapter i to newmovielength - movie_length
					set the name of chapter i of this_track to "Chapter " & (i as string)
					set movie_length to the duration
				end if
			end tell
		end tell
	end repeat
	return input
end run


[ Reply to This | # ]