Wait for before continuing..?

Ok I have the following folder action set to a folder where I download images with Image Capture,
this script will make a new folder based on the current date, move the files to that folder, and then tell portfolio to add this new folder to its catalog.
But what I want to make sure is that the script will wait for each step to finish before continuing.
E.g. the folder action will not start moving files before all of them have been downloaded (not really a huge problem though). But more importantly not to start catalogin the new folder untill all files have been moved to the new folder.
Also, Is there any way to script Image capture to start downloading from a camera to a specified folder? It is possible using Automator, but automator breaks the counter in my script, and therefore I have separated this portion and made it as a folder action.

thanks in advance,
Kristjan.

Heres what I have:
Automator action that downloads to the “TempPhoto” folder
+
Folder action for “TempPhoto” folder:



--prepares my counter
property counter : 1
property lastDay : 0

on adding folder items to this_folder
	--resets the counter to 1, if this is the first import of the day
	if (day of (current date)) ≠ lastDay then
		set counter to 1
		set lastDay to (day of (current date))
	end if
	--stores what the name of the new folder should be
	set DateStamp to "Import " & (do shell script "date +%y-%m-%d") & ¬
		" (" & counter & ")"
	
--makes the new folder, sets it as the target folder, and moves the files
	try
		tell application "Finder" to make new folder at "Macintosh HD:Users:kristjan:pictures:portfolio library:Photos:" with properties {name:DateStamp}
		set FinalFolder to "Macintosh HD:Users:kristjan:pictures:portfolio library:Photos:" & DateStamp as alias
		tell application "Finder" to move (files in folder "Macintosh HD:Users:kristjan:pictures:portfolio library:Temphoto:") to FinalFolder replacing yes
		--Increase the counter by 1
		set counter to counter + 1
	on error errorMsg
		display dialog errorMsg buttons ¬
			"Cancel" default button 1 with title "Import Script"
	end try
	--Portfolio import process
--The catalog option must get the folder path as unicode text
	set CatFolder to FinalFolder as alias
--Tells portfolio to open the specified catalog, and start catalogin the newly created folder
tell application "Portfolio 7.0"
		open catalog alias "Macintosh HD:Users:kristjan:Pictures:Portfolio Library:Portfolio Library.fdb" using mode administrator
		catalog CatFolder to catalog alias "Macintosh HD:Users:kristjan:Pictures:Portfolio Library:Portfolio Library.fdb" with show options
		
	end tell
end adding folder items to

p.s I Must give all credit to the users of this board for I have borrowed heavily from their posts, and would not have gotten this far without their wisdom :slight_smile:

Model: iMac G5
AppleScript: “Tiger version”?
Browser: Safari 412
Operating System: Mac OS X (10.4)