Benches macOS

6

move files out of subfolder into main fol…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

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

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    Kappy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  2. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You could also just use the Finder > Get Folder Contents action (repeating for each subfolder found) and move them into the main (or another selected) folder.

  3. 0

    WillFriedwald2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    thanks -

    it would be easy to do this manually if there were only a few subfolders.

    but right now what I have is over 50 subfolders!

    I would think that this is a simple repetitive action, the kind that could possibly be scripted or automated ...

    any suggestions?

    w

  4. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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)

  5. 0

    WillFriedwald2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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

  6. 0

    HD

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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