Problem: Can't open a list modified by creation in Quicktime

Ok real quick:
This works-



set theFolder to (choose folder)
tell application "Finder"
	set RootFiles to (items of theFolder) as alias list
end tell


tell application "QuickTime Player"
	activate
	open Rootfiles
end tell

That opens the pictures in the folder.

If I try to sort the list by creation date, the new list can’t be opened by Quicktime.


set theFolder to (choose folder)
tell application "Finder"
	set RootFiles to (items of theFolder) as alias list
end tell

tell application "Finder"
		select RootFiles
		set MovieList to reverse of (sort the selection by modification date)
		--> RootFiles  sorted by modification date, oldest to youngest
	end tell

tell application "QuickTime Player"
	activate
	open MovieList
end tell

:?:
That sorts the list, but then the data can’t be read by Quicktime. I need to know how to sort ‘RootFiles’ by creation date in a form that QT can OPEN. :?:

I don’t have any real idea, the only thing I noticed is that MovieList after the sort-operation might not be an alias list anymore:

set MovieList to reverse of (sort the selection by modification date)

Maybe you should add:

set MovieList to MovieList as alias list

Hope it helps
Farid

Tried that, no go. Still open for suggestions-

I think Farid is probably right about your list having Finder references that QT can’t use. I don’t have the ‘sort’ command to work with here in Jaguar, but you can try somehting like this:

set theFolder to (choose folder)
tell application “Finder”
–set RootFiles to (theFolder) as alias list
–end tell

--tell application "Finder" 
--select RootFiles 
set MovieList to reverse of (sort items of theFolder by modification date)
--> RootFiles  sorted by modification date, oldest to youngest 

end tell
set new_list to {}
repeat with this_item in MovieList
set end of new_list to (this_item as alias)
end repeat

Put the list of Finder references through a repeat loop to make a list of alias references.

gl,

As Farid pointed out, the OS 9 Finder’s ‘sort’ command returns a list of Finder references rather than a list of aliases, so QuickTime Player doesn’t know what they are. One way round this (besides Kel’s suggestion, which I’ve just seen) is to get the Finder itself to open the files in the player: the scripted equivalent of a drag-and-drop:

tell application "Finder"
  select RootFiles
  set MovieList to reverse of (sort the selection by modification date)
  --> RootFiles  sorted by modification date, oldest to youngest
  open MovieList using application file id "TVOD"
end tell

My OS 9/X machine is still away. The above has been tested in 8.6 and opens the files in the sorted order.