Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ScottR

macrumors regular
Original poster
May 11, 2007
137
14
Hello. I have a couple hundred folders each containing a single mp4 file; the folder names are useful, the mp4 file names not. How can I rename the mp4s with the folder names? That is, I'd like:
Containing folder>Very helpful name>not38helpful_name.mp4
Containing folder>Another helpful name>Reallyuseless3866l_name.mp4
Containing folder>Clear Concise name>How15this%&4helpful.mp4


to be renamed:

Containing folder>Very helpful name>Very helpful name.mp4
Containing folder>Another helpful name>Another helpful name.mp4
Containing folder>Clear Concise name>Clear Concise name.mp4


It would be helpful to then replace the folder with the file (Containing folder>Very helpful name.mp4) but not necessary.
There are no other files within the folders other than the MP4s so no filtering is needed, and all of the folders (with the MP4s) are in once place ("Containing folder").

thanks
 
Easy: Automator – QuickAction – AppleScript

Code:
on run {input, parameters}
    tell application "Finder"
        set theFiles to input
        repeat with currentFile in theFiles
            set theFolderName to displayed name of (container of currentFile)
            set name of currentFile to (theFolderName & ".mp4")
        end repeat
    end tell
end run

Make a test on a file or several. For all, search the Containing folder for .mp4, select the files, right-click and run the action.
RenameMP4.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.