Folder action help please

Hi

I am trying to create a folder action that will transfer a Dropbox folder full of files to a location on my mac.

What I can’t do is get the Finder to move the folder after the upload of all its contents is complete in the Dropbox.


on adding folder items to this_folder after receiving added_items
	set finderStuff to load script alias "Whopper:Users:xx:Library:Scripts:Library:FinderStuff.scpt"
	--set copy_file to alias "Whopper:Users:xx:Dropbox:xx:"
	set destfolder to alias "Whopper:Users:xxk:PhotoData:Group session data import:Group Clients:"
	finderStuff's moveFile(added_items, destfolder)
end adding folder items to

the finderstuff handler is a straightforward move file/folder

I presume I need some sort of wait until complete command but I can’t find anything of the sort in the dictionary

many Thanks as allways

Hi.

Try looking for busy in system events, but still better, search for “busy” here! :slight_smile:

You can try something like this:

set fSizes to {0}
		repeat
			tell application "System Events" to set end of fSizes to size of this_folder 
			if (item -1 of fSizes) = (item -2 of fSizes) then exit repeat
			delay 3
		end repeat

Thanks Adayzone. This works a treat and is far more elegant than the solution I came up with. It was though on the same lines



	repeat
		set theSize to size of (info for this_folder)
		delay 1
		set theNewsize to size of (info for this_folder)
		if theSize is equal to theNewsize then
			exit repeat
		end if
	end repeat