Move folder's contents based on its name

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Move folder's contents based on its name Wed Apr 04, 2012 9:32 am • by badsandwich
I've been searching around for this and nothing quite covers it

Say I have a folder structure so:

Code: Select all
Reels/
  011/
    1920/
      0932.jpg
    proxy/
      0001.jpg
  022/
 etc…


Is there a way I can process the folders within the Reels folder, so that if I find a subfolder called "1920", I can move the contents of that folder (e.g. to the parent folder)? Bear in mind that I already have a number of rules on the "reels" folder, so "run actions on folder contents" probably won't work for me.
badsandwich
 
Posts: 11
Joined: Wed Apr 04, 2012 9:24 am

Re: Move folder's contents based on its name Wed Apr 04, 2012 11:46 am • by Mr_Noodle
I don't see why you could use the run actions on folder contents action. Read the sticky article at the top of this forum. I'd highly suggest doing tests on a copy of the files in question until you get it right.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:I don't see why you could use the run actions on folder contents action. Read the sticky article at the top of this forum. I'd highly suggest doing tests on a copy of the files in question until you get it right.


Because I have other rules that run on contents of other sub-folders, which I don't want to affect these sub-folders. The problem I have with the folder structure as it is, is that the "identity" of the files I want to target.

Maybe I should explain with a different example.

Say I have a music folder, by album, etc:

Code: Select all
Music/
  Album 1/
   track 1.mp3
  Album 2/
    Disc 1/
      track 1.mp3
    Other/
      track 1.mp3
   etc.


Now, I want to consolidate so there are no disc subfolders, but not touch anything else. So I want to end up with:

Code: Select all
Music/
  Album 1/
   track 1.mp3
  Album 2/
    Disc 1 - track 1.mp3
    Other/
      track 1.mp3
   etc.


Make sense? Is that possible?
badsandwich
 
Posts: 11
Joined: Wed Apr 04, 2012 9:24 am

Yes, though again, nothing you have said precludes using the run rules on folder contents action.

If you want to limit whether a rule runs in a particular folder, you can have it filter on the enclosing folder's name, or use the subfolder level to limit at which level deep it runs. Or, tweak the run on folder contents rule to only match folders folder's starting with "Disc". The run rules on folder actions gives you more flexibility because you can specify any conditions you want on the folder it goes into.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:you can have it filter on the enclosing folder's name


Aha! This is what I was missing. How do I do this, exactly?
badsandwich
 
Posts: 11
Joined: Wed Apr 04, 2012 9:24 am

Hold down the plus button for a condition. This will give you the option to nest a condition (you can alternatively hold down the option key).

In the nested condition, in the "current file or folder pop-up", select "enclosing folder". Any conditions in this subcondition will apply to the parent folder so you can do "Name is blah" under that.

Oh, though, there is one bug now. You used to be able to specify a move to the enclosing folder as a destination. This option unintentionally disappeared and I will be adding it back in in a patch. If you need it urgently, email me at support and I'll send you a link to a test build when it's ready.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ok thanks. No real rush on this, I'm just experimenting.
badsandwich
 
Posts: 11
Joined: Wed Apr 04, 2012 9:24 am


Return to Support