"New Folder with Selection" question

Solution 1:

I would suggest creating a new Service in Automator. Adding a service to the finder will add it in the contextual menu !

  1. Create new service
  2. Servicce receives selected in
  3. Add a run AppleScript Action
  4. Paste the following code

Using just a simple AppleScript

on run {input, parameters}

tell application "Finder"
    set thePath to first item of input
    set ParentFolder to container of thePath
    set theFolder to (make new folder at ParentFolder)

    repeat with aFIle in input #For each file in input 
        move aFIle to theFolder
    end repeat
end tell

end run

Save it and enjoy the new service by selecting your new service in the contextual menu of one of your folders.

Solution 2:

I had this problem in Mac OSX Mountain Lion too, and scoured high and low to find it. Just wanted to share it with you.

Select a single file in Finder, -paste- into the Applescript Editor, and run it. It'll give you a dialog to input the name for the -new folder-.

try
    tell application "Finder" to set the this_folder to (folder of the front window) as alias
on error -- no open windows
    set the this_folder to path to desktop folder as alias

end try

tell application "Finder"
    set selected_items to selection

    set thefoldername to text returned of (display dialog "Folder name:" default answer "new folder")


    set theFolder to (make new folder at this_folder with properties {name:thefoldername}) --added "set theFolder to.."

    repeat with x in selected_items
        move x to theFolder --changed the variable from "thefoldername" to "theFolder"
    end repeat

end tell