Problem with Parent Folder

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

Moderator: Mr_Noodle

Problem with Parent Folder Sun Mar 05, 2017 3:09 pm • by learned
I was hoping that Parent Folder would only give me the name of the exact parent folder. For example, if I have a folder:

/Users/me/TargetFolder/file.txt

I was hoping that ParentFolder would give only TargetFolder. Instead it appears to give the entire path. Is there a way to just get the name of the immediate containing folder? I want to use it in rename actions for files in that folder.
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

Re: Problem with Parent Folder Mon Mar 06, 2017 12:20 pm • by Mr_Noodle
You can do something like this:
Code: Select all
    If (all) match
        If (all) match for (the enclosing folder)
            Name matches (•parent name)

where •parent name is set to match "anything". What that does is capture the parent folder name into the •parent name custom attribute you create. You can then use that in patterns afterwards.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support