Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

renaming subfolders based on parent folder name

I have several hundred folders, each containing a number of subfolders. I would like to create a workflow that will rename the subfolders so they contain the name of the parent folder. No luck thus far...

Posted on Dec 13, 2013 2:03 PM

Reply
6 replies

Dec 13, 2013 2:16 PM in response to Frank Caggiano

Just one level.


What I'm really trying to do is switch the order of my hierarchy. The parent folders are project-specific, the subfolders contain content. For example, I would like to change:


New York

- Images

- History

- Things to do


Boise

- Images

- History

- Things to do


to:


Images

- New York

- Boise


History

- New York

- Boise


Things to do

- New York

- Boise


Just renaming them would be helpful enough, though. Moving them into what will be three new folders isn't a big deal.

Dec 13, 2013 2:40 PM in response to jhla

Each parent folders contains the same named subfolders so that if you get the subs from one parent to make the new parents that will make all the new parents or do some of the parents have different subs?


In other words if I take all the subs from New York and use those names to make new parents is that all there is or does Boise (or Boston or whatever) have different subfolders?


Are there data files in the subfolders and do they have to be moved?

Dec 13, 2013 2:47 PM in response to Frank Caggiano

Yes the parent folders all contain the same folders (some do not contain all of the folders), but the names don't vary from parent folder to parent folder. In otherwords Boise might not contain "Things to do" but it won't contain any uniquely named additional folders, such as "158th Anniversary Parade in Boise Center" or anything like that.


Many of the subfolders do contain subfolders of their own -- I want to keep those in the subfolders they're currently in, but not rename them. In otherwords they should move with the subfolder in question with no changes.


Does that make sense?

Dec 13, 2013 6:57 PM in response to jhla

Many of the subfolders do contain subfolders of their own -- I want to keep those in the subfolders they're currently in, but not rename them. In otherwords they should move with the subfolder in question with no changes.


This is a bit murky.


So you have


New York

- Images

- History

- Things to do


and possibly

Boise

- Images

- Nice Images <<<<<<

- History

- Things to do


So how does that work out in the final set up?


Like this


Images

- Nice Images <<<<<<

- New York

- Boise


History

- New York

- Boise


Things to do

- New York

- Boise


or


Images

- New York

- Boise

- Nice Images <<<<<<


History

- New York

- Boise


Things to do

- New York

- Boise



It's getting a bit evolved. Recreating the hirearcy isn't to much of a problem, moving the subfolders of the subfolders requires some thought.


Message was edited by: Frank Caggiano - Also how much help do you need here, how much Applescript do you know? Do you just need some ideas to get going or do you need more than that?

Dec 14, 2013 5:44 AM in response to Frank Caggiano

I know essentially no applescript. If I can simply rename the subfolders with the name of the parent folder that will be enough. I can manually move the folders and preserve the structure.Your second example (below) is what I'd like in the end.


Images

- New York

- Boise

- Nice Images <<<<<<


History

- New York

- Boise


Things to do

- New York

- Boise


...but again, once they're renamed moving them will be quite easy to do manually.

renaming subfolders based on parent folder name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.