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=]