I’m new to applescript and have been asked to use it to track the status of files being sent to a Mac (OS X Tiger). The problem I have is in locating when a file has completely arrived when sent via FTP. I have tried to do this by using a folder script attached to the folder where the files arrive which successfully checks for name clashes and then executes a repeat loop to check on the size of the incoming files. Unfortunately I have not been able to find a successful method of updating the information retrieved by the repeat loop.
Why does the following always retreive the same values on the incoming file, or the alias of the file or the info of the file. I have tried the ‘busy status’ and 'update 'calls to no avail. I have no experience of Mac shell script whatsoever and scouring the web has drawn a complete blank.
repeat while file_check_counter is less than 10
tell application "Finder"
set data_doc_size to the data size of the this_item
set physical_doc_size to the (((physical size of the this_item) / 1024) / 1024)
set logical_doc_size to (((the size of the this_item) / 1024) / 1024)
end tell
set the file_check_counter to the file_check_counter + 1
display dialog "Data Size is " & data_doc_size & "." & return & ¬
"Physical Size is " & physical_doc_size & "." & return & ¬
"Logical Size is " & logical_doc_size & return & return & ¬
"File check counter is " & file_check_counter & "." buttons {"Cancel"} default button 1 giving up after 10
end repeat
Can anyone please help??