merging by date/time order

I have the script below that merges all the quicktime movies contained in a folder in an alphabetical order.
Is it possible to merge them in a date/time order, instead of alphabetical ?



set tFolder to choose folder -- Select a folder of '.mov' files.
set tList to list folder tFolder without invisibles -- Obtain '.mov' files list.

with timeout of 0 seconds -- Prevent a timeout error message
tell application "QuickTime Player" -- Use 'QuickTime Player' commands.

set mMovie to make new movie -- Create a new (empty) movie.

repeat with i in tList -- cycle through the '.mov' files list.
open (((tFolder as string) & i) as alias) -- Open a movie file.

delay 1
select all movie 1 -- Select all of the movie.
delay 1
copy movie 1 -- Copy all of the movie.
delay 1

close movie 1 -- Close the movie.

delay 1
paste movie 1 -- Paste the copied movie into the initial (empty) movie.

end repeat

delay 1
rewind movie 1 -- Rewind the finished movie.
delay 1
select none movie 1 -- Set 'selector' to beginning position.

-- Save the created movie.
save self contained movie 1 in file ((tFolder as string) & (do shell script ("date +%Y%m%d_%H%M%S_master.mov")))
close movie 1 -- Close the saved movie.

end tell
end timeout


This is quite easy.
You can sort by creation date or modification date.
If you want the oldest file first, delete the line “set tList to reverse of tList”

regards

Stefan

set tFolder to choose folder -- Select a folder of '.mov' files.
tell application "Finder"
	set tList to every item of tFolder whose kind is "QuickTime Movie" -- Obtain '.mov' files list.
	sort tList by creation date -- or modification date
end tell
set tList to reverse of tList -- the items of the list in reverse order (if necessary)
with timeout of 0 seconds -- Prevent a timeout error message
	tell application "QuickTime Player" -- Use 'QuickTime Player' commands.
		
		set mMovie to make new movie -- Create a new (empty) movie.
		
		repeat with i in tList -- cycle through the '.mov' files list.
			open i -- Open a movie file.
			
			delay 1
			select all movie 1 -- Select all of the movie.
			delay 1
			copy movie 1 -- Copy all of the movie.
			delay 1
			
			close movie 1 -- Close the movie.
			
			delay 1
			paste movie 1 -- Paste the copied movie into the initial (empty) movie.
			
		end repeat
		
		delay 1
		rewind movie 1 -- Rewind the finished movie.
		delay 1
		select none movie 1 -- Set 'selector' to beginning position.
		
		-- Save the created movie.
		save self contained movie 1 in file ((tFolder as string) & (do shell script ("date +%Y%m%d_%H%M%S_master.mov")))
		close movie 1 -- Close the saved movie.
		
	end tell
end timeout