11

I browse to a folder, then expand through a directory tree to find the file I'm looking for. Now I want to create a folder at the current location within that tree.

  1. "New Folder" from the menu creates the menu in the top-level directory instead of the current directory.
  2. Right-clicking doesn't give any way to create a folder "in-place" - ie with reference to the file or directory I currently have clicked/highlighted.

Simplified example (thanks soulshined):

/Users/user/Downloads/
/Users/user/Downloads/Pictures
/Users/user/Downloads/Pictures/pic1.jpg
/Users/user/Downloads/Pictures/pic2.jpg
/Users/user/Downloads/Pictures/pic3.jpg
/Users/user/Downloads/Pictures/pic4.jpg
/Users/user/Downloads/Pictures/pic5.jpg

The finder window is opened on the /Users/user/Downloads directory, but I have used the tree-expanders to be looking at the files in .../Downloads/Pictures.

I want to add a folder under Pictures, but irrespective of how I invoke it, the new directory will always be created under Downloads.

(Obviously in this example it would be trivial to move it, but imagine the folder is a byzantine corporate shared directory tree,...)

2
  • This question is confusing me because I can do this without any problems. Can you elaborate a little bit more so I can make sure we're talking about the same thing? Say your in 'Downloads' and Downloads has 4 different folders, you click on one of them [Pictures] and it has a list of pictures and you want to add a Folder to Pictures, say to name [2015] or add a folder to Downloads while viewing the contents of Pictures? – soulshined Jan 30 '15 at 0:06
  • I’m assuming the OP means in list view. I’ll change the title. – Philippe-André Lorin Dec 13 '20 at 12:22
7

Open the folder that you want to create a new folder in, then File > New Folder or Shift-Command-N.

OR

You have first to double-click the directory within which you want to create the new folder. Once you are inside, right-click and select "new directory".

1
  • 6
    The fact that I can't simply right click the folder to create a new one inside is shocking to me and feels like a UI bug. I wonder why apple hasn't fixed this? – mikestaub Sep 5 '18 at 18:14
6

I think the key bit here is: You have first to double-click the directory within which you want to create the new folder.

Selecting File->New Folder (or Shift-Command-N) won't create a new folder in the current folder (or at least what I would consider to be the current folder)

For example, in the image attached, I would expect "New Folder" to create a new folder inside folder1 (selected) - instead, it will create it in the "Guest" folder - which was the originally opened folder.

To create it in folder1, you first need to first double click folder1.

enter image description here

1
  • 1
    Wow. Thanks! This has to win the Apple's Least Intuitive Feature award. – frozenjim Dec 29 '19 at 15:10
2

This is how I create new folder in the Finder (list view) with keyboard only:

  1. (up/down arrows) - Highlight the folder
  2. CommandO - Open the folder on the same tab
  3. CommandShiftN - create new folder
  4. type the name of the folder Enter
  5. CommandOption8 - go back to the previous folder (same as back button click) Info: The 5. step is same as Command[ shortcut, but I use hungarian keyboard and for the [ character I have to hit the Option8 combo.

On windows + total commander I only had to press F7 button to create new folder :)

2

As of OSX Catalina,

CommandShiftN Creates a new folder within the folder within the open window (in your example, the ~/Downloads directory). File > New folder, the context menu, and the Actions (gear) menu have the same behavior, regardless of what is selected.

This is inconsistent with pre-Catalina in my experience. I don't know why this changed. The only method is to double-click the Pictures directory first.

0

Here’s a script you can use for this. It works both in list and column views. The renaming part doesn’t work properly in icon and gallery views, which can be annoying.

To use it with a shortcurt, I exported it as an application from Script Editor and set a shortcut to that application in Butler. I used the standard Finder shortcut for “New folder”, since I don’t need icon and gallery views, but you may prefer something different to still be able to use the regular shortcut. Note that the app must be granted accessibility permissions (System Preferences › Security › Confidentiality).

You may want to adjust the delays to your system’s reactivity, as they can be annoying if you’re used to type the new folder’s name quickly after it’s created. Hoewever, if they’re too low, renaming won’t work.

-- By Philippe-André Lorin
-- 2020-12-13
-- macOS 10.14.4
-- See https://apple.stackexchange.com/a/408759/185198

-- Create folder inside currently selected folder
-- or at the same level as currently selected file

try
    tell application "Finder"
        set selectedItems to selection
        set currentPath to ((the first item of the selectedItems) as alias)
        
        -- Set parent path for future new folder
        if (currentPath as string) ends with ":" then
            -- It’s a folder
            set the parentPath to currentPath
        else
            -- It’s a file
            set {savedDelimiters, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
            set the parentPath to (text items 1 thru -2 of (currentPath as string)) as string
            set AppleScript's text item delimiters to savedDelimiters
        end if
        
        -- Create new folder
        my createFolder(parentPath)
    end tell
    
on error -- No folder or file is selected
    tell application "Finder"
        set the currentPath to (folder of the front window as alias)
        my createFolder(currentPath)
    end tell
end try


on createFolder(folderLocation)
    tell application "Finder"
        -- Make new folder
        set thisFolder to make new folder at folderLocation
        delay 0.2 -- N.B. Without delays, the following operations sometimes fail.
        
        -- Select new folder
        set selection to thisFolder
        delay 0.2
        
        -- Call “Rename” menu in Finder
        activate
        tell application "System Events"
            tell application "System Events"
                tell process "Finder"
                    tell menu bar 1
                        -- N.B. The following must be adjusted to the Finder’s language settings
                        tell menu bar item "File"
                            tell menu "File"
                                click menu item "Rename"
                            end tell
                        end tell
                    end tell
                end tell
            end tell
        end tell
        
        -- Return
        return thisFolder
    end tell
end createFolder

Note. This script was adapted from the first script on this page: http://hints.macworld.com/article.php?story=20081119025327978

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .