Skip to content

Instantly share code, notes, and snippets.

@skull-squadron
Last active December 12, 2015 01:08
Show Gist options
  • Save skull-squadron/4689051 to your computer and use it in GitHub Desktop.
Save skull-squadron/4689051 to your computer and use it in GitHub Desktop.
New Folder From Selection (Service that works with 1+ files instead of 2+)
on run {input, parameters}
tell application "Finder"
set thePath to first item of input
set {dispName, nameExt, isHidden} to the {displayed name, name extension, extension hidden} of thePath
if isHidden or nameExt is equal to "" then
dispName
else
(characters 1 through (-2 - (count of nameExt)) of dispName) as text
end if
set theNewFoldersName to result
set ParentFolder to container of thePath
set theNewFolder to (make new folder at ParentFolder with properties {name:theNewFoldersName})
repeat with aFIle in input #For each file in input
move aFIle to theNewFolder
end repeat
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment