Group files Applescript
tagged AppleScript, Quicksilver, Technology and User Interface
In Photoshop, I use Group Layers shortcut (Command + g) all the time. This takes any layers you have selected, and puts them into a folder/group. It’s a very fast and nice way of working.
I wanted a way to do this in Finder – a quick internets googlefy returned a few examples of something similar. One worked well, but it popped up a dialog box to enter the name of the folder. I’m not a fan of modal dialogs, so after removing some of the script, and adding a few lines, I now have a script that uses standard finder naming methods for creating and then allowing you to name the resulting folder. Here ‘tis:
tell application “Finder” set the_folder to container of item 1 of (get selection) as alias
end telltell application “Finder”
set new_folder to (make new folder in folder the_folder) move selection to new_folder
end tell
tell application “Finder” select new_folder
end tell
tell application “System Events” keystroke return
end tell
Download the script here in 2 wholesome varieties:
Plain editable Script – Example use: Set up as a Quicksilver Trigger
Script compiled as an app. – Example use: Place in Finder Toolbar or launch via Spotlight.
You can put these files anywhere really, but I suggest the Applications folder, or the Script folder in your home directory. ( ~/Library/Scripts/ ).
Setting up a Quicksilver Trigger:
Step 1 – Get Quicksilver
Step 2 – Open its preferences and click the trigger pane button on the toolbar.
Step 3 – Create a new Custom Trigger by clicking the [+] button, choosing Hotkey and setup
the resulting window as shown in the below Screenshot. Press Save.
Step 4 - Assign a Hotkey in the drawer that opened up at the side of the window.
I chose Command + g. (of course)
Step 5 – In the drawer, under the scope tab, type “Finder”. This confines the Hotkey for use
in the Finder only, so it won’t interfere with other apps.
Step 5 – Close the Quicksilver preference window.
Step 6 – Be confused that there are 2 step 5’s for no reason….
Step 7 - Test it by going to Finder, selecting some files and Triggering the script via the Hotkey you defined

Putting Script app in Finder Toolbar:
Step 1 - Drag and hover the App script over the blank space on
a Finder window until a little box slides ‘open’, then let go.
Step 2 – Test it by going to Finder, selecting some files and Triggering
the script by clicking on the icon in the Toolbar.

Well, that is it. Hope this brings you and your family hours of totally awesome pleasure.
Side note bonus! I find myself thinking of the files that are needing action (in this case, grouping) before figuring out how/what to do with them. This works for me, but does anyone think the other way around?