I have files in folder and one automator action that get those files and up it to ftp server, this work with an action folder. But only work if i add new files in this folder, no work if i modified the files that are inside it. How i can made an applescript that get this recent modified files and pass to the next action (up to ftp)
global theWatchedFolder
set theWatchedFolder to choose folder
on idle
tell application "Finder"
set theDetectedItems to every item of theWatchedFolder
repeat with aDetectedItem in theDetectedItems
move aDetectedItem to the desktop
end repeat
end tell
if theDetectedItems <> {} then
activate
display dialog "New items were detected and moved to your desktop."
end if
return 1
end idle
The problem seems to be “<>” without those dont work, and with those dont compile…
You know solve it?
Consider that occupying the Finder once per second to gather files is a waste of resources.
A launchd agent is a much better solution, because it’s passive and getting notified by the file system