Dropping multiple files onto droplet app. . .

So I have a few different render droplet apps and I have been looking into finding a way to create more of a queueing behavior. Right now you can easily have many renders going at once but it would be much more efficient to have them queue up one after the other.

I am curious if there is a way to use the “on open” command to be able to take in a selection of files rather than just the one dropped on it? Or will I need to use “on run” and allow the user to select multiple files that way? It would also be really nice if I could have a list that could list the files dropped and allow the user to select which ones they would like to render. And by render what is really happening is a shell script is being assembled based on the path of the dropped file as can be seen in the current version:



(*

	[AERenderFlags CS4]
	--Based on code originally developed by Dustin & Cody Beltram.
	
	-Drop the project file you would like to render onto this applet and whatever is configured in the Render Queue of that project file will begin 
	 rendering in Terminal.
	-If you would like to use any additional flags this version will bring up a dialog that lets you enter any additional aerender flags
	
	v_1:
	-developed basic functionality
	-added render flag options

*)

on open {droppedFile}
	
	--Ask to enter any additional render flags
	set render_flags to text returned of (display dialog "Enter additional Render Flags:" default answer "")
	
	--Set the project file path
	set projectfile_path to the quoted form of (POSIX path of (droppedFile as text))
	
	--Set the Render Command
	set render_cmd to "'/Applications/Adobe After Effects CS4/aerender' -sound ON " & render_flags & " -project " & projectfile_path
	
	--Launch Render in Terminal
	tell application "Terminal"
		activate
		do script with command render_cmd
	end tell
	
end open

I basically need to end up with something that can spit out something like this to Terminal:

"‘/Applications/Adobe After Effects CS4/aerender’ -sound ON " & render_flags & " -project " & projectfile_path && "‘/Applications/Adobe After Effects CS4/aerender’ -sound ON " & render_flags & " -project " & projectfile_path &&

etc. etc. Based on the number of files that are dropped or chosen. An && command in between them should queue everything up just fine.

Thanks for any info. If this isn’t clear let me know and I can be a little more specific.

I think this is what you want to do


(*
	[AERenderFlags CS4]
	--Based on code originally developed by Dustin & Cody Beltram.
	
	-Drop the project file you would like to render onto this applet and whatever is configured in the Render Queue of that project file will begin 
	 rendering in Terminal.
	-If you would like to use any additional flags this version will bring up a dialog that lets you enter any additional aerender flags
	
	v_1:
	-developed basic functionality
	-added render flag options

*)

on open {droppedFiles}
	
	--Ask to enter any additional render flags
	set render_flags to text returned of (display dialog "Enter additional Render Flags:" default answer "")
	set render_cmd to ""
	repeat with afile in droppedFiles
		--Set the project file path
		set projectfile_path to the quoted form of (POSIX path of (afile as text))
		--Set the Render Command
		set render_cmd to render_cmd & "'/Applications/Adobe After Effects CS4/aerender' -sound ON " & render_flags & " -project " & projectfile_path
	end repeat

	--Launch Render in Terminal
	tell application "Terminal"
		activate
		do script with command render_cmd
	end tell
	
end open