Search code examples
macostimerautomationapplescriptdirectory-structure

OS X Applescript check how long file has been in folder


I cannot figure out how accomplish this simple task.

I'm trying to put action scripts on all my folders to help sort my documents. I'm also trying to avoid downloading a file, and having to try and catch it.

My solution is a script that will trigger when a file has been in the folder for more then a certain period of time.

This is what I have.

-- I was thinking of putting something here to delay it, but I'm not sure if that would be the best solution --

on adding folder items to master_folder after receiving new_files

    tell application "Finder"
        move new_files to dest
    end tell

end adding folder items to

I'll post a solution if I can find one, but until then thanks!


Solution

  • Alternative Solution

    Folder actions aren't really equipt for the job. As Vadian mentioned, they don't control latency. So the answer to me question is that it isn't possible yet.

    It is possible to create an application, or something besides a folder action, and monitor the contents of said folder. I've been using Hazel, but I'm sure there are other solutions.