Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Flatten a directory structure ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Flatten a directory structure
Authored by: Maxikubik on Feb 27, '13 08:29:42AM
This is of course also possible with an AppleScript:

--flattens a folder structure by moving all files from all sub-folders to the selected folder
--files with the same name will cuase an error message
tell application "Finder"
	set theTopFolder to (choose folder)
	set theFiles to a reference to every file of (entire contents of folder theTopFolder)
	set theNewFolder to make new folder at theTopFolder with properties {name:"Flattened Files"}
	move theFiles to theNewFolder
end tell
Just use it as is or modify it to your liking!

[ Reply to This | # ]