Let me just warn you, this hint is a little technical. But when you are done with these steps, you will be able to set your desktop pictures to any of the the Beach, Cosmos or Forest pictures from the built-in screen savers, without using any additional hard disk space (aside from a few kilobytes for folders and hard links). The image at left shows what you'll wind up with when you're done; click on the image for a larger version.
[robg adds: This hint is a more thorough and elegant solution than that presented in this older hint, which basically involves copying the images out into another location. If you'd like the simple method, use the older hint. If you'd like more options and no wasted drive space, then read the rest of this hint.
I have tested every step of this process, and it does work as described -- the image at left is from my machine, after completing the modifications. Note that future system updates may overwrite your work, as this hint involves modifying a couple of system files.]
As strange as it seems, there is no simple way in the Finder to count all files in a folder, including the files in the subfolders. Some solutions were discussed in an earlier macosxhints article, but there is also a straightforward way to do this using AppleScript.
Copy and paste this script into Script Editor, and save it as an Application. Then just drag and drop a folder onto the icon, and you'll get a file count. You can also download the completed droplet from its VersionTracker page.
[robg adds: This works, but be aware that the total presented does not include the subfolders themselves -- it just counts the files themselves.]
I like using hot corners to activate Exposť. I also like to use multiple displays to expand my desktop. Unfortunately, when the desktop is spread across two displays at the same resolution, hot corners are active only at the outside corners of the combined desktop, not at the inside corners of each display. You have to take your cursor all the way to the right edge of the rightmost display to activate a right-edge hot corner. And with two wide-screen displays, that's quite a trek.
The trick, then, is just to slightly mis-align the displays in the "Arrangement" tab of the Displays panel in System Preferences. Nudge the display on the left slightly above the display on the right, and two new corners are created: the upper-right corner of the display on the left, and the lower-left corner of the display on the right.
The corners at the far edges of each display are still active, too. So now you have six corners: upper left, upper middle, upper right, and lower left, lower middle, and lower right.
It's not quite the same as having all four corners active on each display, but two short-stop hot corners can save you a little mileage on your mouse.
After giving your root password, a Finder window with root privileges pops up behind your Terminal. Do the dangerous stuff you want to do but weren't able to do with "normal" privileges (eg copying Fink's entire /sw folder). When you're done being dangerous, close your root Finder window by pressing Control-C in the Terminal (thus exiting the sudo command). The root Finder window will vanish.
Note that other Finder windows you had open when creating the root window will retain their original file privileges and will not become root.
[robg adds: As with anything running as root, be very careful with this one. You can do some Really Bad Things. This hint is to be used at your risk ... have you backed up lately? :) ]
If you command-drag an application out of the dock, you're actually dragging the application file itself. This is great for downloaded programs: If you like it, just command-drag the program from the dock to the programs folder, and it's installed.
[robg adds: I don't believe we've covered this before -- we did discuss command-clicking dock icons, but not command-dragging them. With this trick, you can actually move running applications (as you could do in the Finder, of course) when you do this. Nothing will break if you move it while you're running the app, of course. But the next time you go to launch that app, you might be surprised to find its no longer in its folder -- and at that point, the app itself may complain about missing files.]
I was using drag and drop to copy text from a webpage to TextEdit by using Command-Tab to switch to TextEdit. When I switched to TextEdit, I realized that I didn't have an open document. Rather than cancelling the drag, I tried to create a new document by hitting command-N mid-drag. Amazingly, it worked ... and I dropped my text into the new blank document. Then I started to play around with this feature...
When drag and dropping using the app switcher and Exposť (but not between windows or with the dock), you can issue key commands to the current frontmost application (such as command-N to open a new document, command-W to close a document etc) you can also use command-` to cycle through open document windows, and the arrow keys or page keys to navigate the open document before you drop.
In fact, you can also type into the destination document before you drop (for example, start a text drag, command tab to switch to TextEdit, type a few keystrokes and they appear in the document, then drop the text drag.)
Combined with Butler (or LaunchBar or QuickSilver, etc.), you have something very cool. With TextEdit not open, start a text drag. Hit Control-Space to bring up Butler, type in the abbreviation for TextEdit, and return to launch it. Hit Command-Tab, switch to TextEdit, and drop your text.
This seems to work in all Carbon and Cocoa apps.
[robg adds: I thought we'd published something about this before, but I can't find it in the database. If someone finds that this is a dupe, please let me know...]
I noticed a while ago that it is possible to 'force quit' an application in another way than is already documented (Command-Option-Escape or Control-click an active app in the dock). I found out that it is sometimes also possible by hitting the Command-Option-Q keys after tabbing to the selected app you want to quit.
It is not a real force quit, because when you try it on an app that is not stuck, it will ask you to save the active document first. But sometimes an app is not responding. In this way, you are able to quit that app in most cases.
I have created a script (view source) to work with images, specifically, images you'd like to email. I'm not a pro, so this script is based on the apple "image-duplicate as jpeg" script that can be found in the /Library -> Scripts -> Folder Action Scripts folder. It's designed to be used as a script action on a folder. When you put a pic in the folder, the script creates a copy of it, then asks for the target resolution and degrees of rotation, and then finally puts the final version into a new blank mail message.
[robg adds: I tested this, and it worked just as described. I saved the file as a script, then created a new folder and attached the script as a folder action. Drag and drop an image file onto the folder, answer the two questions, and presto -- new mail message opens with my resized and rotated image attached.]
I have been working on a Folder Action Script (view the source) that can be attached to the desktop and will move any snapshot file created with Command-Shift-3 (it does not reliably handle images created with Command-Shift-4) to a "Screen Shots" folder on the desktop, changes the format of the file while adding a preview icon, and renames the file according to the time the snapshot was taken.
One major hurdle that I have not completely overcome, is that folder action scripts cause the front application to come out of focus. My partial solution has been to code everything without using calls to other applications. For example, everything that I would usually do with a tell application "Finder" call, I do using do shell script calls instead.
The other major hurdle was to make sure the PDF picture file that is created on the desktop is non-empty. It seems an empty placeholder is created before the real snapshot is placed on the desktop. This makes the script interfere with the command-shift-4 mechanism. It's also important to make sure it's not being written to. That is what makes things seem sluggish (OS X is not good at updating a file's state; I would imagine to increase performance, right?). I started this script by modifying an Applescript I found in the MacOSXHints forums (Applescript strcmp? by Lankhmart).
I hope it is useful, and that someone more knowledgable can help me improve on the above shortcomings.
[robg adds: A couple of previoushints discuss other methods of handling screenshots.]
Often times, I like to gather a group of files that I have downloaded or created in their own folder, and often I would like that folder's name to be based on the name of one of the files being gathered.
This AppleScript, which I usually invoke from the Applesripts menu, does this by offering me a choice of alphabetically-sorted names that I can further modify, or create my own name. It is based on snippets and ideas I have gleaned elsewhere.
[robg adds: Copy and paste the text into a new script editor document, and save it as a script in your user's Library -> Scripts folder (create this if necessary). Then select a number of files in the Finder, and choose the script name from the AppleScript menu. You will be given a list of the selected filenames, from which you can choose one as the basis for a new folder name. After naming the folder, the chosen files will be moved into that folder. I tested on a duplicated folder, just to be sure things worked!]