Applescript to Sort Folders into 4 group folders based on Folder Name variable

Discussion in 'Mac Programming' started by philhtn, Dec 3, 2009.

  1. philhtn macrumors newbie

    Dec 3, 2009
    Trying to create an Applescript that can be executed (contextual menu, but would prefer a droplet.)

    Need to sort a list of folders into 4 sub folders. The sort will be based on if the folder name contains specific numbers in parenthesis ( ).

    For example:

    The Mother Lode of Folders - Typically would be handling 30-150 folders at a time
    566811-(8) UnitarianComm
    599363-(23) Healthway
    607595-(13) Epiphanychurch
    599361-(23) GolfRoundUp
    608611-(RF) ChristCommun
    602703-(52) ArtandAntique
    743820-(71) DCReproducti
    743821-(58) DrClaireStaggRuda
    602701-(65) TobaccoCity
    The key variables for the sort are the numbers or letters in the parenthesis

    Need to sort into 4 Sort Folders named:

    Fort Pierce (includes numbers: 1,2,3,4,5,6,7,8,9,10.11,12,19,48 and any Alpha's)
    Vero Beach (includes numbers: 13, 20 though 29)
    Melbourne (includes numbers: 50 through 69)
    Daytona (includes numbers: 70 through 79)

    The Alpha's can get tricky as they are always changing, so any alpha could default to the Fort Pierce folder.

    I would like to drop their containing folder on to a droplet and the Applescript would create the 4 Sort Folders in the same directory as the folders to sort. After the Applescript is completed, the group folders will be manually copied/deleted by an end user so when the script is executed again no existing Group folders will interfere. (so the copy/delete is not part of the Applescript

    Any help would be greatly, greatly appreciated.
  2. robbietherobot macrumors newbie

    Oct 12, 2005
    Smart Folders?

    Have you considered setting up some Smart Folders with simple Booleans?

    IE. For the Alphas it would be...any folder that doesn't contain "(0" or "(1" or "(2) etc...

    Might take about 20 mins to get everything you want but it's very powerful.

    Melbourne for example would be simply anything that's "(5" or "(6" and not "(5)" or "(6)"
  3. philhtn thread starter macrumors newbie

    Dec 3, 2009
    Thank you for your reply robbietherobot. Much appreciated.

    I like the simplicity of it, but I need something that would stand alone for our workflow since I do have some technology curveballs.... I only have one mac with 10.4.11 and the rest are running 9.2.2 This is why I need it in an Apple Script droplet.

Share This Page