The following AppleScript traverses the currently-selected folder in the Finder, moves the contents of all subfolders of that folder up to the top level, then moves the (now empty) subfolders to the trash.
[robg adds: Copy and paste the above into Script Editor, then switch to the Finder, select a folder, switch back to Script Editor, and press Run. Because this script is non-reversible, I strongly recommend first using it on a non-critical test folder -- a duplicate of the folder you intend to flatten, for instance. That's how I tested it, and it worked as described (at least in 10.5; I don't know if it will run in 10.4). If this is something you do often, you could save the script to your user's Library » Scripts » Applications » Finder folder, where it'd be available from the Scripts entry in the menu bar.]
This hint was inspired by a study that found red wallpaper conducive to detail-oriented work, while blue wallpaper works better for creative work. Based on that, I wrote a simple AppleScript to display a dialog that allows the user to choose between working environments. The script then sets the desktop picture based on the user's selection.
Note that this hint assumes you've already created the new solid colors (very dark gray, very dark blue, and very dark red) as explained in this previous hint. Once you have those colors (or others, if you prefer; just change the script as necessary), create the following AppleScript:
[robg adds: I tested this, and it works as described. If you want to use more colors, you need to change both the buttonList and colorList lines so that they remain in sync. The list of colors in colorList must exactly match the colors' filenames as seen in the Finder.]
There are many published methods to put files in named folders based on date created or modified, but this one puts them in corresponding folders based on the date the file was added to the folder, similar to the sorting option for stacks in the Dock -- I use this to organize my Downloads folder.
The following AppleScript works by exploiting the HFS+ inode table, and retrieves the date which the file's name was added to the directory tree, regardless of when it was previously modified or created in other locations.
It could probably use some optimization, so feel free to make suggestions if you're an AppleScript geek!
[robg adds: This works as described, at least on the folders I tested it with. Note there's no going back, of course, so if you run the script, you'd have to manually restore the flat folder structure if you change your mind. A couple of other hints in this category include organizing the Downloads folder by download date (which changes the files' modifications times to re-sort them) and using Hazel to sort items in folders (among its other features).]
Note: This hint was lost when the site was hacked on April 23rd. I've reposted it, and the comment thread, as best as I could. --robg
In the Finder's list view, if you sort by Kind, folders are lumped together in the middle of the list. If you'd rather see all the folders at the beginning of the list, here's how to change the sort order.
In the Finder, navigate to /System » Library » CoreServices » Finder.app » Contents » Resources » English.lproj (or the folder for your language). In that folder, open the InfoPlist.strings file in a pure text editor.
Inside the file, find this section and entry:
/* General kind strings */
"Folder" = "Folder";
Leave the first line alone, but change the second to read:
"Folder" = " Folder";
Note that I have added only a single space before Folder. Save the file after making the change, and then restart OS X. To test your change, open a Finder window and view by Kind (either via View » Show View Options, or by pressing Command-2, then clicking on the Kind column header).
robg cautions: As noted in the comments, this hint will break OS X 10.5's code signing for the Finder. In theory, this will have some bad consequences, as you'll no longer be able to access the keychain when using the Finder. Proceed at your own risk; if you undo the edit, at least based on my testing, things will return to normal (code signing checks will pass).
[robg adds: This is an update to this much older hint, which required modifying a system-wide framework. Note that restarting isn't required; just restart the Finder via Terminal, Activity Monitor, or Option-click-and-hold its Dock icon.
If you want folders at the end of the list, instead of the beginning, you'll have to use one of a few special characters:
µ (mu): Option-M
π (pi): Option-P
Ω (omega): Option-Z
I also did a bit of experimenting with the Edit » Special Characters palette. Most any Greek letter (European Scripts » Greek in the All Character view) will force a name to the end of the list, as will some Cyrillic characters. But that's about it; pretty much everything else I tested forced the names to the front of the list.]
Today I noticed that you can force Spaces to move windows to another Space while retaining their relative position on the screen. To do so, open the Spaces overview (F8 by default), and hold the Command key while dragging a window to another Space.
I found this by accident and don't think it's that useful, but perhaps you will...
[robg adds: This was mentioned in a comment to this hint, but I thought it worth sharing as a real hint. In testing it, the behavior varies between programs with one window (iCal) and those with many windows (iChat, Safari, whatever). If a program has but one window, then Command (or Shift or Control) will move it while retaining its location. If a program has multiple windows, any of those keys will move all of that program's windows while retaining their positions. I couldn't, in fact, find a way to move all windows of a program to another Space without retaining their positions -- I had to manually move them within the new Space (again, while holding any of those keys so that all windows moved) to change their position.]
This is a simple AppleScript for the Finder which moves the currently selected items into a newly-created folder, and puts the new folder into rename mode. I use this to quickly sort my files into properly-named folders.
If you are like me, you have a lot of entries in the Places section of the sidebar in Leopard's Finder. What if you want a Smart Folder that aggregates your favorite/recent places (or provides any Smart Folder functionality), but you don't want to have to scroll down to the Search For section of the sidebar? In other words, you'd like to place your Smart Folders in the Places section of the sidebar.
By default, Apple disables moving Smart Folders to the Places category of the sidebar. So how do you get around this? Easily.
Take any saved search on the sidebar, Control-click on it and select Open Enclosing Folder from the pop-up menu. Then select your search and choose File » Make Alias, and drag the alias to your sidebar. Done!
[robg adds: I think this can be further simplified -- once the enclosing folder is visible, you can drag any of the visible Smart Folders directly to the Places section of the sidebar; no alias is required (at least not on my 10.5.6 machine it's not).]
It's trivial, but convenient: create a quick and dirty 'contact sheet' of images using Quick Look, three simple keyboard shortcuts, and one mouse-click:
Open the folder containing the set of image files.
Press Command-A, Command-Option-Y, click the Index Sheet button, then press Command-Shift-3.
Just that easily, and you've made a contact sheet from the Quick Look display -- you'll find it on your Desktop, in a file named Picture 1. With a very little bit of coding, you can turn this into a simple script, too.
Some of you might be using the hidden setting to control the number of entries in the Recent Items menus (as in this hint or via TinkerTool) to disable the menus entirely, for example on shared computers or other situations.
Unfortunately, the Finder has a menu of recently-accessed folders in the Go menu that nobody has yet found a way to disable. In case you really need to get rid of this feature, here is a crontab line that will clear the menu every minute:
* * * * * osascript -e 'tell application "System Events" to click menu item "Clear Menu" of menu of menu item "Recent Folders" of menu of menu bar item "Go" of menu bar of process "Finder"' >&/dev/null
It works by clicking on Finder's Recent Folders » Clear Menu menu item every minute. The nice thing is that it does so in an invisible manner, without bringing Finder to the front or otherwise disrupting your workflow, and it wastes only a few milliseconds of processor time every minute. This is a generic technique that may be applied to all sorts of needs: just look at the string of menu labels, and adapt to your needs.
You will need to enable access for assistive devices in the Universal Access System Preferences panel for this to work.
[robg adds: If you need help with crontab, this older hint provides a decent starting point.]
To create an iPhoto-like size-adjustable icon view of a folder, just put "" (with nothing inside the quotes) in the search box in a Finder window. Set it to the folder of interest, and to search by name, and choose icon view.
Now you can see a view with the zoom scroller on the bottom right. Very useful to see images or videos on folders.
[robg adds: This is a variation on this older hint, which used a smart folder to display a narrow range of results with the slider; this method just opens it up to all files within a folder. Alternatively, as noted in the original hint, you could just opt to leave the View Options window open instead, as it contains a slider for icon size (as well as grid spacing).]