Script to make a new folder

I’ve never done any scripting, or I would do this myself, but I’d like to be able to drag a selection of files to an icon, and have a new folder created, and those files moved (or copied… doesn’t matter really) to that new folder.

And it would be nice to have the folder be named one of the names of the files selected. If that’s to hard, then just a generic name will do.

I have about 100 files that I have to seperate, and this would help me a lot

any ideas where I can find something like this that will work on OS X?

thanks

cidion

This might be close to what you want. Save it as an application in Script Editor to turn it into a droplet.

on open files_
	try
		tell application "Finder"
			set container_ to container of item 1 of files_
			set name_ to name of item 1 of files_
			if exists alias ((container_ as text) & name_ & " ƒ") then
				set new_ to make new folder at container_
			else
				set new_ to make new folder at container_ with properties {name:name_ & " ƒ"}
			end if
			move files_ to new_
		end tell
	on error errMsg
		display dialog errMsg
	end try
end open

– Rob

wow, that was quick.

and it works brilliantly, thanks a lot!

cidion