"fileisbusy" addition not working

Hey guys,

I’ev tried adding the fileisbusy addition to one of my scripts, and it just won’t seem to work.

Here’s what I did:

on adding folder items to pdfFolder after receiving added_items
       tell application "finder"
       activate
       repeat with I in added_items
           tell application "finder"
           set fileBusy to true 
           repeat while fileBusy 
           set fileBusy to fileIsBusy I 
           delay 1 
           end repeat
           display dialog "it works"
         end repeat
         end tell
end adding folder items to

I’ve tried adding both “file” and “alias” before “I”, but neither one will work.

The files coming into this folder are from another server, and they grow slowly as the server refreshes. The script picks up the file right away (before it’s finished), and gives an error message.

Any ideas, anyone?

Thanks!

Does this work? I haven’t tested it but it uses ‘info for’ to obtain the ‘busy status’ of a file (‘info for’ is provided by the Standard Additions scripting addition).

on adding folder items to pdfFolder after receiving added_items
	repeat with i in added_items
		if folder of (info for i) is false then
			set fileBusy to true
			repeat while fileBusy is true
				set fileBusy to busy status of (info for i)
				delay 1
			end repeat
			display dialog "it works"
		end if
	end repeat
end adding folder items to

– Rob