Automatically move files created in a folder to a folder that has their name... Help?

Discussion in 'macOS' started by iansilv, Mar 26, 2013.

  1. iansilv macrumors 65816

    Jun 2, 2007
    Hi- I was hoping someone here might have the knowledge to do something that I would Reeeeallly like to do to save myself time.

    I have a scanner and I scan things that I name after a client name along with a description of the document. I have a separate folder on my server for each client. I want a program to check the folder that my scans go to and move files that it sees to their correct folder based on whether a folder exists with their name in it...

    For example- If I scan a letter and name it "George Michael Client Letter" I would like this program (or solution) to see it, check my "clients" folder, and see if there is a folder in there entitled "George Michael" (or "Michael, George"). If there is, I want the scanned letter to be moved in to that folder and no longer exist in the folder where all my scans go....

    Is this possible? I don't need a real-time check. It could simply run in the background, checking periodically to see if any files have names that contain words equal to folders in the clients folder...

    thank you in advance to anyone who can give some help here.
  2. benwiggy macrumors 68020

    Jun 15, 2012
    Certainly. Folder Actions allow you to run an Automator sequence or AppleScript when a file is added to a particular folder.

    The trick would be in writing an AppleScript (or Unix shell script, wrapped in Automator) that can do what you want.

    Someone here may offer to knock something up, or you may be able to cobble something together from various scripts that people have posted online.

Share This Page