I have an folder action which is designed to ftp a file or files to a specified place, the issue I have with this script is that, it does not send any files if they have been updated. It does not seem to look at the modified time. I need it to run the script each time a file is modified or added. The script is shown below. Any help fixing this issue is greatly appreciated.
property NIXLB : "
"
on adding folder items to this_folder after receiving added_items
set userName to "insertname"
set userPassword to "insertpasswd"
set hostName to "host"
set remoteDir to "/folder/folder/folder"
tell application "Finder"
repeat with i from 1 to count of items of added_items
tell application "Finder"
set localFile to POSIX path of (item i of added_items)
set fileName to item -1 of my explode("/", localFile)
set remoteFile to (remoteDir & fileName) as string
do shell script "ftp -n ftp://" & userName & ":" & userPassword & "@" & hostName & " << EOF" & NIXLB & "put " & localFile & space & remoteFile & NIXLB & "bye" & NIXLB & "EOF"
move file (item i of added_items) as string to folder "Sent" of startup disk
end tell
end repeat
end tell
end adding folder items to
on explode(delim, theString)
if theString is "" then
error "No path defined"
else
set od to text item delimiters of AppleScript
set text item delimiters of AppleScript to delim
set thelist to every text item of theString as list
set text item delimiters of AppleScript to od
return thelist
end if
end explode
Model: any mac runniing os X
Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416
Operating System: Mac OS X (10.4)