Skip to content

Instantly share code, notes, and snippets.

@kyleridolfo
Created March 18, 2010 18:07
Show Gist options
  • Save kyleridolfo/336654 to your computer and use it in GitHub Desktop.
Save kyleridolfo/336654 to your computer and use it in GitHub Desktop.
tell application "Finder" to set theObjects to selection
set nameForNewFolder to "Gathered"
tell application "Finder"
set myOrFilesContainer to (container of item 1 of theObjects) as alias
try
make new folder at myOrFilesContainer with properties {name:nameForNewFolder}
set myContainer to (folder nameForNewFolder of myOrFilesContainer) as alias
on error theMsg
display dialog theMsg buttons "Cancel" cancel button 1
return
end try
end tell
repeat with i in theObjects
tell application "Finder" to move i to myContainer
end repeat
tell application "Finder" to reveal myContainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment