With the help of Applescript you will be able to join the folder files in just one

Applescript programming language

It has happened to many of us, that we received a binder full of others folders loaded files, you must then gather the files in only one binder, doing it manually is wasting your precious time, but the application apple script to give us a hand in this tedious task.

The first step is to open the Script Editor found in Applications / Applescript. A new window will appear; there copy and paste the following:
tell application "Finder"
activated
set theTopFolder to (selection as aliases)
–Display dialog (theTopFolder as text)
repeat with EachSubDir in (get every folder of folder theTopFolder)
try
–Display dialog (EachSubDir as text)
repeat with Eachfile in (get every file of folder (EachSubDir as aliases))
try
move Eachfile to theTopFolder
end try
end repeat
delete folder (EachSubDir as aliases)
end try
end repeat
end tell.

Use the script, after choosing the binder you want in the Finder and note that the script just locate files in the folders first level; In good Spanish, this means that if within a binder first level there is another binder, this subfolder will go straight to the trash with its internal load of files.

If this work is something everyday for you, then you can save the script and if for example you want to compile all files Relating to a print job that is filed in multiple folders will be helpful as well.

Via | Faq-Mac


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   jose said

    Either I just don't understand it very well (very likely) or I don't see any sense in this script if you have 1 folder with several subfolders and in turn with other subfolders. It is not supposed to work in this case, right? If I have understood it correctly, it only works if within the main folder there are one or more folders but no more within these. Please, someone clarify it for me
    Thank you

  2.   Li-Moon said

    Yes, Jose, that's how it works ... it applies to first-level folders, that is, they don't have others inside. You have a folder with other subfolders, but they don't have others inside, they have files, but no other folders ... ok? Otherwise the sub-folders would be deleted and the information you have there would be lost, so I think it would be better do it manually ...

  3.   jose said

    Thank you ????

  4.   Raul said

    I don't understand, that is, I put all that in the applescript and it tells me that there is syntax error, (expected expression, property or class form, etc. But unknown identifier was found