Automated Sort Script.

Hi everyone,

I’m trying to make a script that will take every folder I drag and drop into “Music” and sort it into its respective directory. I have A, B, C, and so on… So “Jack Penate” would go to “J” and “7 Seconds” would go to my “#” folder and so on. My experience level with scripting is pretty minimal and I’ve only made shell scripts on Gentoo Linux.

Any help would be appreciated,
-Matt

Hi,

try this folder action


on adding folder items to this_folder after receiving these_items
	repeat with oneItem in these_items
		tell name of (info for oneItem) to set destination to quoted form of (POSIX path of this_folder & text 1 & "/" & it)
		do shell script "/usr/bin/ditto " & quoted form of POSIX path of oneItem & " " & destination & " ;/bin/rm -r " & quoted form of POSIX path of oneItem
	end repeat
end adding folder items to

It worked!

Thanks! :smiley:

All I had to do was save the script and copy it to “/Library/Scripts/Folder Action Scripts”

Folder action scripts must be located in (~)/Library/Scripts/Folder Action Scripts

Yeah I just figured that out. :slight_smile: