Folder Actions, Naming a File by Parent Folder

So I am installing a server with a somewhat complex hierarchy of folders.
There will be 140 Folders on the top level of the server named 000-“folder name” to 140-“folder name”, and within those folders there will be folders with the numbers 01 through 05 on each tier. (Example top Folder is 021-Folder, in that, is 00-folder, 01-folder, 02-folder etc., and in the 03-folder there is a file. This file would be named 005-03-“file name”.)
I was hoping that I could build a folder action that would rename a file that is dropped into the bottom level folder, to reference the parent folders beginning numbers. Does that make sense/sound feasible?

I am relatively new to scripting, and from all the research I’ve done, all I’ve found is this script is probably way over my head.
If anyone has any ideas on how I could script a template folder with the folder actions in it that will rename the file being dropped so I could copy template 140 times and the file names would reference the proper folder name, I would love to hear them! And please let me know if you like me to elaborate further =)


  • Brian


A folder action will only watched the folder it is attached to, not a folder’s subfolders. I recommend you purchase Hazel which has the ability to watch subfolders.