Limiting size of nested folders for archiving

I have a script to create archived folders that limit the size to 660mb. I am trying to archive folders that are nested. Does anyone know what I can add to the script below so nested folders can be archived also.

set max_folder_size_in_mb to 660
set images_folder to "LaCie:Archives:INM29148:"
set archive_folder to "LaCie:mike_ burn:"
set subfolder_counter to 1
tell application "Finder"
	activate
	repeat until (count files in folder images_folder) is 0
		set folder_name to "splitfolder" & subfolder_counter
		set archive_sub_folder to make new folder in folder archive_folder with properties {name:folder_name}
		set image_list to list folder alias images_folder without invisibles
		set file_list to {}
		set total_MB to 0
		set file_counter to 1
		repeat while ((total_MB is less than max_folder_size_in_mb))
			set fileName to item file_counter of image_list
			set file_size to size of (info for alias (images_folder & fileName))
			set file_size_in_MB to (file_size / 1024 / 1024)
			set total_MB to total_MB + file_size_in_MB
			set file_counter to file_counter + 1
			set fileMovin to images_folder & fileName
			try
				move file fileMovin to archive_sub_folder
			on error
				display dialog "There was a problem moving the file from/to - " & images_folder & fileName & " " & archive_sub_folder buttons ("Cancel") default button 1
			end try
		end repeat
		set subfolder_counter to subfolder_counter + 1
	end repeat
end tell

thanks
Michael Wendelken/TSR
Nec Inc.
345 7th Ave Suite 1101
New York,NY 10001
Phone: 646-733-9166 ext. 4009
Fax: 646-733-9178
mikew@necinc.com

:?:

This has been covered in other threads. Take a look at this one in particular:

http://bbs.applescript.net/viewtopic.php?t=6507

Jon

PS You should delete your post in the other forum.

Jonn thanks for the script. I am having a problem with it though. After it creates the subfolder a message comes up which is “Applescript timed out”. Any suggestions. Thanks again.

Trash Man, The reply to your original request is bad. did you make any progress on buried subfolders. I also gave it a shot and did not come up with a solid solution. A Program called cdfolder partition is a shareware for Mac OS9 it sorta works in OSX also, it does exactly what i want but it is does not except AppleEvents and I need something that is native to OSX and scriptable. if you have come up with something please let me know.

Thanks

Arnold
amondrag@c-k.com