Automator: Move files into new subfolder based on file's name Disclaimer, this may not be something Automator can do. 

I have a large directory of movie files. In order to use a piece of software, each movie needs to be in it's own folder. I'd like to create some sort of automation to do the following:


Create folders named after each filename ex: Cool Movie.m4v =&gt;  Cool Movie ƒ
Move movie file to corresponding folder


I'm hoping that between Automator, Bash, or AppleScript, there's a way to do this.

Clarification:

If I have a folder that looks like this:


Movies ƒ


Movie A.m4v
Movie B.m4v
Movie C.m4v



I'd like it to look like this after:


Movies ƒ


Movie A ƒ


Movie A.m4v

Movie B ƒ


Movie B.m4v

Movie B ƒ


Movie B.m4v
I had a similar question and with the help of wch1zpink came up with this solution. In automator:


create a new workflow
add get selected finder items
add run applescript 
replace the script with this:

tell application "Finder"
    set selectedFiles to selection as alias list
    set containingFolder to container of item 1 of selectedFiles as alias
    repeat with i from 1 to count of selectedFiles
        set thisItem to item i of selectedFiles
        set fileName to (text items 1 thru -5) of (name of thisItem as text) as string
        move thisItem to (make new folder at containingFolder ¬
            with properties {name:fileName})
    end repeat
end tell