move files out of subfolder into main folder

I have a bunch of files in subfolders :

mainfolder A / subfolder 1 / file a
mainfolder A / subfolder 1 / file b
mainfolder A / subfolder 1 / file c
mainfolder A / subfolder 2 / file d
mainfolder A / subfolder 2 / file e
mainfolder A / subfolder 2 / file f
mainfolder A / subfolder 3 / file g
mainfolder A / subfolder 3 / file h

is there a script or automator thingie that will automatically move them all into the main folder? Like as follows :

mainfolder A / file a
mainfolder A / file b
mainfolder A / file c
mainfolder A / file d
mainfolder A / file e

etc?

have used scripts (especially in iTunes) but never the automator - would appreciate any help!

w

powerMac G5 (single processor, darn it!); 4 GB RAM, Mac OS X (10.4.9), World's Largest iTunes library: Over a TB & Growing Daily!

Posted on Feb 23, 2008 4:23 PM

Reply
6 replies

Feb 23, 2008 8:42 PM in response to WillFriedwald2

Well, it's relatively easy manually.

Open a separate Finder window for mainfolder A by COMMAND-clicking on the folder. Move this folder to the right of the other Finder window. Now navigate to subfolder 1 in the left Finder window and press COMMAND-A to select all the files in that subfolder. Drag the selected files to the right Finder window. This moves them all where you want them. Now repeat this for the files in the other subfolders. When you finish all the files will have been moved to mainfolder A.

I know this isn't the most elegant solution, but it may take a lot less time then it would take you to write a script or an automator action. Unless, of course, you want the programming experience.

Feb 24, 2008 7:56 AM in response to WillFriedwald2

I was referring to an Automator action. Getting the name of the parent folder can be tricky depending on exactly what you are wanting to do, and there is the issue of all the resulting empty folders, but I was thinking about something like the following:

1) Get Specified FInder Items (drag your folder to the window)
2) Get Folder Contents (Repeat for each subfolder found)
3) Move Finder Items (select the original folder) (Copy Finder Items to a selected folder can also be used)

Feb 24, 2008 8:26 AM in response to red_menace

ah! thank you!

was about to try it - when I discovered that the files I want to work on are "locked," or rather, they're on an external USB drive in DOS format - and I don't have permission to write to the drive.

Short of copying the files off onto a mac-format (HTFS+) drive, is there anything I can do to change permissions on this external DOS drive so I can write to it & unlock it?

thanks again

w

Feb 24, 2008 8:37 AM in response to WillFriedwald2

It can certainly be AppleScripted:

set main_folder to (choose folder with prompt "Choose the main folder")
tell application "Finder"
set sub_folders to folders of main_folder
repeat with each_folder in sub_folders
move every file of each_folder to main_folder with replacing
end repeat
end tell


but PLEASE NOTE: if you have any duplicate file names, only the last will survive the move. I strongly suggest you try this on a test folder before you use it on you live data.

H

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

move files out of subfolder into main folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.