Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Clear Finder's Recent Folders list at shut down Desktop
Snow Leopard only hintI use the following method to automatically clean, at shut down time, the entries in the Finder's Go » Recent Folders menu entry. It cost me some work, but eventually it worked. Open Terminal and do the following:
$ cd /etc/
$ sudo nano rc.shutdown.local
When prompted, enter your admin password. In the nano editor, add the following lines (assuming the file doesn't yet exist):

cd /Users/your_user/Library/Preferences/
defaults delete /Users/your_user/Library/Preferences/ FXRecentFolders
chown your_user:your_group
And now some explanation. your_user is obviously the short name of the user whose Finder preference file you want to edit. your_group is the group your user belongs to -- this is usually staff.

The chown command is needed because these commands are executed by the script as root. So the defaults delete command changes the ownership of the file, resulting in the loss of your Finder's preferences at reboot. For the same reason, the commands specify the full path to files, because the script isn't running as your user.

The rc.shutdown.local file does not need to be set as executable. It works like it is, but please remember to reboot twice after any change in order to see the effects.

[robg adds: I haven't tested this one. To confirm your user's group membership, you can use groups (which has technically been replaced by the less-obvious id -Gn, but still works in 10.6).]
  Post a comment  •  Comments (8)  
  • Currently 2.53 / 5
  You rated: 1 / 5 (19 votes cast)
[13,835 views]  View Printable Version
How to use a spatial Finder in OS X Desktop
One common gripe for the Mac old-timers is the switch from the 'Spatial Finder' of OS 9 to the 'Browser-style Finder' of OS X (pioneered in Windows 95). You can relive the old days now in Snow Leopard with this tip.

As a bit of background: OS 9 treated displayed each folder's contents only once on screen, and always in its own window, and always in the same place on-screen. This was done to mimic the real life desktop and folder paradigm. OS X follows a more web-like paradigm, where each Finder window can be used to view any folder's contents, and a single folder can be viewed simultaneously in multiple windows.

However, you can relive the old days of OS 9's spatial Finder by turning off the sidebar and toolbar. To do this, click the capsule-shaped button in the upper right of a Finder window. Once the sidebar is gone, opening folders will act like they did in OS 9: opening into their own windows.

Note, it's actually possible to have both OS 9-style folder windows and OS X-style browser windows open at the same time.

[robg adds: This behavior isn't new in Snow Leopard; it works the same way in 10.5. Also, if you use column-view mode, this hint doesn't work; it only applies to opening folders when using icon or list view modes.]
  Post a comment  •  Comments (28)  
  • Currently 1.97 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (34 votes cast)
[8,687 views]  View Printable Version
Take a picture with the iSight camera when a folder is opened Desktop
This script describes an AppleScript that uses Imagesnap, a public-domain command line tool, to take a photo with the built-in iSight camera when a specified file is opened. It saves the photo as a JPEG with a filename based on the time/date, and then hides the JPEG. The light by the side of the camera will flash briefly when the snap is taken.

This hint could be very easily adapted to run lots of different functions, for example taking a screen shot. Before writing this script, I had not realized the large potential of Folder Actions Setup. Also described is a method to simply temporarily disable the action when you are opening the folder.

First create a new folder called UnixApps in the main (top-level) Library folder. After downloading Imagesnap, place the Imagesnap application in the new folder (resultant path: /Library/UnixApps/imagesnap). It could easily be saved elsewhere, but that would require some small changes to the AppleScript.
read more (694 words)   Post a comment  •  Comments (3)  
  • Currently 2.32 / 5
  You rated: 4 / 5 (28 votes cast)
[23,716 views]  View Printable Version
Use an alternative Earth-from-space desktop picture Desktop
Apple includes many high-quality desktop pictures with all Macs, including NASA’s iconic Blue Marble picture of the Earth from space. While I hold nothing against Apple for including the version of the image that shows the western hemisphere, primarily North and South America, I thought it would be nice to have a version of the image that actually shows the part of the planet where I live, namely the eastern hemisphere.

NASA provides a high-resolution image (7.2MB TIFF) of the eastern hemisphere Blue Marble. Download the image, and place it in the same folder as Apple’s pre-installed Nature images: /Library/Desktop Pictures/Nature

The Apple image is simply the Blue Marble superimposed on a pure black background to fit a 16:10-ratio widescreen display without distorting the image. However, NASA’s original image is perfectly square. You therefore need to select the image from the Desktop tab of the Desktop & Screen Saver preference pane and choose Fit to Screen. The sides will probably be filled with a default aqua blue colour, so click on the color palette picker and select a black fill color for the remainder of the screen space (try the Licorice crayon).

Extending the original image file to fill a computer screen without any space left on the sides (Apple’s image is at 2,560 x 1,600 pixels) is an easy exercise in Photoshop or GIMP that is left to the reader! Note that users who have the latest iMac models have a 16:9-ratio screen, which may affect the desired extended image size.
  Post a comment  •  Comments (1)  
  • Currently 2.29 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (24 votes cast)
[7,648 views]  View Printable Version
Create a Mac Pro-like metal desktop background Desktop
I was looking for a weird (don't ask why) background for my desktop, and I thought of the pattern for Dashboard's widget bar (a Mac Pro-like perforated metal strip). How could I make this into a uniform desktop pattern? The answer lies in /System » Library » » (Control-click and pick Show Package Contents from the pop-up menu) » Contents » Resources.

First, I located perf.png in that folder, and dragged it to my desktop. Then, I opened that copy in Preview. I cropped this to 10x10 pixels, starting from the top hole with a one-pixel left margin, and ending below the hole to right (see example at right).

(On certain computers, for some reason, there is a different bottom to the hole. Leave a margin of one pixel if the hole is 3x4, and no margin if it is 3x5.) Save the file as a PNG, and then set it as your desktop picture with the Tile option. Result? Full metal desktop.

[robg adds: The image above is from my machine, and it's actually 9x10, but it worked in my testing...though I reverted to my rotating set of desktop pictures after testing.]
  Post a comment  •  Comments (13)  
  • Currently 2.50 / 5
  You rated: 5 / 5 (14 votes cast)
[16,273 views]  View Printable Version
Enable write flag on Drop Box files via Folder Actions Desktop
Generally, when files are dropped in your ~/Public/Drop Box you can only read them. You have to save a copy if you edit it. I wanted a script that would enable writing and that moved them to your desktop. So I wrote a Folder Action that let me do both things. If I could not enable them because of limitations, I want a sudo (SuperUser Do) to be used.

Here is my AppleScript to do this:
on adding folder items to thisFolder after receiving theseItems -- create list of files & folders
  try -- in case you can't due to limitations
    repeat with thisItem in theseItems -- take a file to repeat with
      set thisPath to quoted form of POSIX path of thisItem -- puts the shell path in quotes for ease of use
      set thisCommand to "chmod u+w " & thisPath -- the command
      do shell script thisCommand -- execute the file
    end repeat
    move theseItems to desktop
  on error
    repeat with thisItem in theseItems -- same except with sudo
      set thisPath to quoted form of POSIX path of thisItem
      set thisCommand to "sudo chmod u+w " & thisPath
      do shell script thisCommand with administrator privileges -- added the sudo part
    end repeat
    move theseItems to desktop
  end try
end adding folder items to
[robg adds: To use this, save the script in your user's Library » Scripts » Folder Action Scripts folder, and then attach it to your Drop Box folder as a Folder Action. In 10.5, Control-click on the Drop Box folder and select More » Attach a Folder Action from the contextual menu; in 10.6, choose Folder Actions Setup from the contextual menu. I haven't tested this one. Also note this hint, which explains Drop Box folder permissions in a clear and easy-to-understand manner.]
  Post a comment  •  Comments (5)  
  • Currently 1.69 / 5
  You rated: 2 / 5 (16 votes cast)
[6,293 views]  View Printable Version
10.6: Create a Service to copy a file path URL to the clipboard Desktop
Snow Leopard only hintThis simple Automator Service will copy the path of a Finder item to the clipboard as a file:// URL; this is very helpful in my environment, where I need to send a shared file's location to someone, rather than emailing around copies of a file.

In Automator, create a new Service and set it to receive selected files or folders in the Finder. Next add the Copy to Clipboard action. For the final step, drag in the Run a Shell Script action, and paste in the following code (all on one line, replacing any existing code):

sed -e 's/:/\//g' -e 's/\ /%20/g' -e 's/^/file:\/\//g' | pbcopy

This transforms the Mac-style colon-delimited path into a POSIX path, and prepends file://, so the path becomes a clickable link when pasted into an email.

[robg adds: This worked as described in my testing.]
  Post a comment  •  Comments (23)  
  • Currently 2.67 / 5
  You rated: 4 / 5 (18 votes cast)
[17,033 views]  View Printable Version
Minimize windows in slow motion via hot screen corner Desktop
Do you like the slow motion effect on minimization, but do not like to hold the Shift key every time you do it -- and you dislike double-clicking the title bar when you want to minimize a window? If so, then take a look at the following AppleScript. I use this AppleScript with CornerClick, which is a (free) utility that lets you assign actions, including running AppleScripts, to the corners of your screen.

With the following Applescript, you can trigger a "Minimize with slow motion effect." Assign it to a corner using CornerClick, and you can minimize a window in slow motion with a flick of the mouse. Here's the script:
tell application "System Events"
  keystroke "m" using command down
  key down shift
  delay 0.3
  key up shift
end tell

tell application "System Events"
  set proc to name of the first process whose frontmost is true
  tell process proc
    -- add error trapping here
    tell its window 1
      set w to its name
      if get value of attribute "AXMinimized" is false then
        tell application "System Events"
          keystroke "m" using command down
          key down shift
          delay 0.3
          key up shift
        end tell
      end if
    end tell
  end tell
end tell

say "Collapse" using "Alex"
You'll see the script tries to minimize twice, as sometimes OS X does not react on the first try with CornerClick. It also provides audio feedback when it's done. Try it out if you like; it's just a visual effect, nothing more.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (1)  
  • Currently 2.56 / 5
  You rated: 3 / 5 (18 votes cast)
[6,127 views]  View Printable Version
Manually switch to next desktop picture in shuffle mode Desktop
I noticed that if you have your desktop picture (wallpaper) set to shuffle between a number of images, and you don't like the currently-selected picture, you can manually skip it by killing and restarting the Dock. Just type the following into Terminal:
killall Dock
When the Dock restarts, it will shuffle to another desktop picture.

[robg adds: I believe a "friendlier" version of this command is killall -QUIT Dock, which tells the Dock to quit nicely, instead of force quitting it. (This is wrong; see the comments!) If you find yourself doing this regularly, you could turn it into a simple Automator application, using the above command, or the AppleScript alternative (tell application "Dock" to quit). Then again, if you're doing this a lot, perhaps you should look to change your collection of desktop images!]
  Post a comment  •  Comments (6)  
  • Currently 2.15 / 5
  You rated: 5 / 5 (13 votes cast)
[8,213 views]  View Printable Version
Highlight the current date on a GeekTool 'cal' geeklet Desktop
I've noticed that a number of people (in addition to myself) like to display the output of the cal utility in a GeekLog geeklet (see this older hint, for example).

Unfortunately, there's no easy way to highlight the current date in the output, and the only workaround I've seen mentioned is to run the output through awk to put braces around the current day. That's a bit ugly for my taste, so I endeavored to find a way to highlight the current day with another color.

My solution uses perl, and instead of putting braces around the current date, it replaces everything but the current date with a space, and strips out the header lines (the month and the weekdays):

cal | perl -wne 'BEGIN{chomp($d = `date "+%e"`)} if (/^ *\d/) {s/\b$d\b/"#" x length($d)/e; s/\d/ /g; s/#+/$d/g; print}'

To use this, you make two calendar Geeklets in GeekTool: one which displays the normal output of cal, and one which displays the output of the above command with the text in a different color (I chose yellow), both in a monospace font, of course. Finally, you position the single-day calendar precisely over the full-month calendar, so that the highlighted day sits exactly over the current day.

As the day changes, it should always align with the full-month calendar behind it, making it appear as though the current day is highlighted. The end result is seen in the image at right.

There's one caveat: GeekTool does weird things to the spaces if you center the single-day calendar output, so you'll need to make sure that at least that Geeklet is left-aligned. The full-month calendar can still be center-aligned, though.
  Post a comment  •  Comments (9)  
  • Currently 2.31 / 5
  You rated: 3 / 5 (13 votes cast)
[20,705 views]  View Printable Version