Drop box for subfolders

I’m at my newbie wits end trying to make aliases of several files from numerous folders to a single folder. Hopefully someone can point me in the right direction. I have it mostly working if I target one folder but not its subfolders.
Situation:
We’re running Panther and we have a drop box with student folders where the students upload their work to be critiqued and graded. I want a script to make an alias of their InDesign document within a single folder for each particular ssignment. Their document is supposed to have “Crit1-” etc in the title but that’s not very reliable. The folders are set up something like this but the structure within each student folder could vary with their addition of other subfolders:
f Drop Box
f �CRITIQUE 1
f �CRIT2
f StudentA_Folder
=> Crit1-A_InDesign file
=> Crit2-A_InDesign file
f graphics
f fonts
f StudentB_Folder
f crit1 => Crit1-B_InDesign file
f graphics
f fonts
f crit2 => Crit2-B_InDesign file
f graphics
f fonts

My crappy solution:
Since the due dates are different (and I don’t know any better way), I’m planning on running one script for the first critique and at a later date, run a second script for critique 2, etc.
This is my only attempt for critique 2 that actually works but I can’t figure out how to search more than one folder nor get any subfolders. I’ve enjoyed reading and re-reading the forum archives but when I’ve tried to adapt from examples in the forum, I usually get an undefined error. Perhaps a kind AppleScript guru can spin me in the right direction.

Newbie code:

property dtpFiles : {"indd", "qxd"}
property theExixtList : {}
property wantList : {}
property theFileList : {}
tell application "Finder"
	activate
	set UploadFolder to folder "StudentA" of folder "Drop Box" of folder "Public" of folder "a" of folder "Users" of startup disk
	set theExixtList to displayed name of every file of entire contents of folder "�CRITIQUE 1" of folder "Drop Box" of folder "Public" of folder "a" of folder "Users" of startup disk whose class is alias file
	set theFileList to displayed name of every file of entire contents of UploadFolder whose name extension is in dtpFiles
	repeat with i from 1 to the count of theFileList
		set thisItem to item i of theFileList
		--if thisItem contains "Crit1" then
		--copy thisItem to the end of theExixtList
		--else
		if thisItem is not in theExixtList then
			copy thisItem to the end of wantList
			--end if
		end if
	end repeat
	make alias to every file of entire contents of UploadFolder whose name is in wantList at folder "�CRIT2" of folder "Drop Box" of folder "Public" of folder "a" of folder "Users" of startup disk
	
	--return theExixtList
	--return wantList
	--return theFileList
	
end tell

:?
Thanks for any suggestions.
watchjb[list=]

Hopefully this will help.

This script will search a folder (and all of its subfolders) for files matching either a file type (contained in file_types) or an extension (contained in file_extensions)–adjust both properties as necessary. For all found files, it will then make aliases of the matching files into target file that you specify. If you save this as an application, you can specify the folder to search using drag and drop (just drop the folder on the script icon in the Finder) and the first time you run the script, it will ask you to locate the target folder for the aliases but on all subsequent runs, if will use the same folder unless it is no longer available in which case it will ask again.

This may not be exactly what you want but it should get you close.

property file_types : {"IDd3", "XDOC"}
property file_extensions : {"ind", "indd", "qxd", "qxp"}
property target_folder : ""

on run
	open {choose folder with prompt "Choose a folder to search:"}
end run

on open the_folder
	try
		get target_folder as alias
	on error
		set target_folder to ""
	end try
	if target_folder = "" then set target_folder to (choose folder with prompt "Choose a location for the aliases:") as string
	set the_files to get_folder_list(((item 1 of the_folder) as string), file_types, file_extensions, true, false)
	tell application "Finder"
		repeat with i from 1 to (count the_files)
			make alias to file (item i of the_files) at (target_folder as alias)
		end repeat
	end tell
end open

on get_folder_list(the_folder, file_types, file_extensions, with_subfolders, inc_folders)
	set the_files to {}
	tell application "Finder" to set folder_list to items of folder the_folder
	repeat with new_file in folder_list
		try
			set new_file_type to file type of new_file
			set new_file_extension to name extension of new_file
		on error
			set new_file_type to "folder"
			set new_file_extension to ""
		end try
		if file_types contains new_file_type or file_extensions contains new_file_extension then set end of the_files to (new_file as string)
		if new_file_type = "folder" then
			if inc_folders = true then set end of the_files to (new_file as string)
			if with_subfolders = true then set the_files to the_files & my get_folder_list((new_file as string), file_types, file_extensions, with_subfolders, inc_folders)
		end if
	end repeat
	return the_files
end get_folder_list

Jon

Jon, Wow This is great!
I’ll work on it tonight to see if I can get it to omit files that are already aliases.
Thank you, this really helps. Maybe I can even figure out how it does its subfolder magic.
watchjb