So looking around I’m trying to move files from this Out folder to the server by repeating to infinity (as long as the folder exists) for files that are 30 minutes old. But I’m not getting more than errors about latching on to these files. I was hoping to avoid another repeat loop by using “every” and “whose”.
Is there a better way? thanx, sam
property this_folder : "Homer:Users:Shared:acrobs homer:proofs:Out:"
property zacrob : "MrJr:Zacrobs:"
tell application "Finder"
if folder zacrob as alias exists then
tell (every file of (this_folder as alias) whose (modification date is greater than (current date) - (30 * 60)))
move every file to (folder zacrob as alias) replacing yes
end tell --every file
end if
end tell --finder
-- Save as stay-open application. Quit from dock.
property zacrob : "MrJr:Zacrobs:" as alias
property this_folder : "Homer:Users:Shared:acrobs homer:proofs:Out:" as alias
on idle
tell application "Finder"
try
move (every file of folder this_folder whose modification date > ((current date) - 30 * minutes)) to zacrob replacing yes
end try
end tell --finder
return 300 -- seconds
end idle
This will idle in the background using almost no resources, then run every fifth minute (plus its run time) after it starts.