Last active
December 12, 2015 01:08
-
-
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+)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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