Search code examples
automationapplescriptosx-mountain-lion

Applescript - easy script to take pictures OUT of folder at bulk


i need a simple generic script [which works on folder opened in finder] that will extract all files from folders while keeping folders alive.

Ie. i have 10 folders and each has 1 file inside. After running script id like to have in same place 10 files and 10 empty folders.

I had some tries with applescript but somehow failed :(


Solution

  • Try:

    set mainFolder to (choose folder)
    tell application "Finder"
        set theFiles to files of (entire contents of mainFolder)
        move theFiles to mainFolder
    end tell