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

Set per-computer Dock placement System
I have a mobile account set up where my user account synchronises files and settings between my MacBook and my desktop Mac. Since the desktop Mac has a dual monitor setup, I put the Dock in the bottom position, so it's closer to the middle of the two monitors. On the MacBook Pro's widescreen display, though, I prefer the Dock on the left, to give more vertical height for the other windows.

Unfortunately, due to the account synchronisation, whichever preference I set on one Mac automatically gets set to the same value on the other Mac. However, there's a way to solve this with the use of the Mac OS X defaults system.

What is needed is a preference setting which is specific to a certain Mac, which can be synchronised but will not apply to the other one. Technically, we need to set the preference in the preference domain for the current host, rather than for any host, which is the default (For more details, see Apple's docs). This can be done from the command line by giving the -currentHost flag to the defaults command, like so:

defaults -currentHost write orientation bottom

This will write a preference setting specific to the Mac you're working on.

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (8)  
  • Currently 4.11 / 5
  You rated: 4 / 5 (9 votes cast)
[5,908 views] Email Article To a Friend View Printable Version
Use an AppleScript to manage Spotlight indexing System
I wrote an AppleScript droplet to manage the settings of Spotlight indexing for a volume. It's called Refocus, and may be downloaded from here.

To use it, drop a volume icon on the Refocus application icon and you'll be prompted to enter your password. After entering the password, if the dropped volume's Spotlight indexing is turned on, you'll be prompted to either turn it off, rebuild it, or cancel. If the dropped volume's indexing was turned off when dropped, you'll be prompted to turn it on or cancel. If you run the script without dropping anything, the operation will be performed on your startup disk. You'll then be asked to confirm that the full path of the disk that will be re-indexed is the disk you dropped. That path will be a Unix style path such as '/' for your startup disk or '/Volumes/archives/' for a disk named 'archives.' The script won't do anything if the disk you dropped appears in the Privacy area of the Spotlight System Preference pane.

If you want to create a version of the Refocus droplet that doesn't require you to enter your password each time you drop a volume icon, run the included 'Create Refocus with Authentication' script. If your password changes, you'll have to create the droplet again, of course.

Usage suggestion: Keep Refocus in your Dock. If indexing begins after a volume is mounted and you know you don't want it indexed, drop it on Refocus to quickly and permanently stop indexing for that volume.

[crarko adds: I haven't tested this one. The downloaded disk image has both the droplet (which can be opened in AppleScript Editor to view the source and the source to the modified script that saves the password.]
  Post a comment  •  Comments (2)  
  • Currently 3.67 / 5
  You rated: 1 / 5 (3 votes cast)
[5,533 views] Email Article To a Friend View Printable Version
Copy results from the Spotlight Calculator System
As many know, Spotlight in the menu bar provides calculator functions. If, for example, you enter


you'll get a listing in the Spotlight results showing

100+4 = 104

As long as this listing is selected, using the keyboard shortcut for Copy, Command+C, will place the result of the equation on the Clipboard.

[crarko adds: I tested this in 10.6.4, and it works as described. I know we've run hints about the Spotlight Calculator before, but I couldn't find this perhaps obvious, but still useful, one.]
  Post a comment  •  Comments (4)  
  • Currently 4.00 / 5
  You rated: 1 / 5 (10 votes cast)
[6,710 views] Email Article To a Friend View Printable Version
Move folders that are expected in specific locations System
Quite a few badly written apps like to create folders in specific locations, and expect them to be there and nowhere else. For example, my ~/Documents folder contains items such as 'Microsoft User Data', 'Steam Content', 'TomTom', etc. Some even create folders in your home directory or worse, at the root level of the hard disk!

Sometimes you can set a different location in the preferences of the application, but sometimes there's just no way. If you move the folder, the application will become hopelessly confused and/or create a new copy where it expects it. You can make these folders invisible, but then you can't easily access them anymore.
read more (295 words)   Post a comment  •  Comments (11)  
  • Currently 3.82 / 5
  You rated: 1 / 5 (11 votes cast)
[11,548 views] Email Article To a Friend View Printable Version
Java for Mac OS X 10.6 Update 3 System
Apple released Java for Mac OS X 10.6 Update 3 (and a corresponding Java for Mac OS X 10.5 Update 8) through Software Update shortly after the Back to the Mac event. The general release notes are here and the security fixes are listed here.

However, those are not the most interesting items about this release.
read more (145 words)   Post a comment  •  Comments (11)  
  • Currently 4.13 / 5
  You rated: 2 / 5 (8 votes cast)
[7,791 views] Email Article To a Friend View Printable Version
Launch Services DB lost after Time Machine Restore System
After you performed a Time Machine System Restore, and you start to open some documents in Finder you will get prompts of the kind 'You are opening the application XYZ for the first time. Are you sure you want to open this application?' as if your computer was freshly installed, not having any file/type associations.

Why this is happening: the Launch Services Database was somehow not restored. Its settings were cached, and cache folders seem to be ignored in the restoration process (for good reasons).

If you want to easily and efficiently control/edit the file/type/mime/URL-scheme-handler associations, then I recommend the preference pane: RCDefaultApp

Other helpful resources:

The FAQs of RCDefaultApp give a good idea about how Launch Services works.

How to rebuild the launch services database.

Launch Services Reference at the Apple Developer site.

[crarko adds: I haven't tested this one. RCDefaultApp has certainly been a useful tool to have around for a number of years now, and is still good in Snow Leopard. (Removed an erroneous assumption of mine.]
  Post a comment  •  Comments (4)  
  • Currently 2.75 / 5
  You rated: 1 / 5 (8 votes cast)
[3,573 views] Email Article To a Friend View Printable Version
Easily encrypt Time Machine backups System
One missing element of Time Machine has been the ability to encrypt the backups. There have been suggestions of ways this can be done to an AFP connected network share using a sparse disk image, but not on a directly connected device. The method below shows how to accomplish this on a local volume.
read more (335 words)   Post a comment  •  Comments (15)  
  • Currently 2.50 / 5
  You rated: 1 / 5 (8 votes cast)
[20,903 views] Email Article To a Friend View Printable Version
Launchd wildcard characters System
One of the occasional irritations of working with launchd is that it doesn't naturally expand shell wildcard characters (~,*,?,...). This means that full paths have to be spelled out for all files: an annoyance at best, and an obstacle when commands need to select specific groups of files or do work across different home folders. For example, a command to clean certain files from a user folder when any user logs in, which is simple enough to write in the shell -- rm -f ~/Folder/*.xxx -- fails when written into a launchd plist.
read more (116 words)   Post a comment  •  Comments (4)  
  • Currently 3.85 / 5
  You rated: 3 / 5 (13 votes cast)
[4,623 views] Email Article To a Friend View Printable Version
Fix a non-connecting Bluetooth controller System
Occasionally the bluetooth process can decide it doesn't want to connect to any devices. Turning bluetooth off means you can't re-enable, but with Bluetooth Explorer, you can force it to do so.

When in this broken Bluetooth state, trying to connect to any Bluetooth device will cause an error. I usually try turning off Bluetooth when it has issues, but in this state it will refuse to turn back on (the menu bar option for 'Turn Bluetooth On' is greyed out). I'm sure a restart would fix, but I've found that if you have the Developer Utilities installed, Bluetooth will do the trick.

Simply start up the app, located in /Developer/Applications/Utilities/Bluetooth/, and it will give you a message about turning on the controller -- ignore this, as it doesn't seem to help. Once it's started, go to the 'Utilities' menu and select 'HCI Controller Selector'. In most machines, I think you'll just have one 'Apple Inc, Bluetooth USB Host Controller.' Select the controller, hit 'Activate', and Bluetooth goes back to normal.

[crarko adds: I don't know if this is just 10.5 specific. I've never encountered the issue. However, the Bluetooth Explorer utility can provide a wealth of information about not just your controller, but any Bluetooth device it can detect. Go to Devices» Show Device Discovery and then select a device and click 'Get Device Info...' It's a handy little app.]
  Post a comment  •  Comments (2)  
  • Currently 3.25 / 5
  You rated: 2 / 5 (4 votes cast)
[6,158 views] Email Article To a Friend View Printable Version
A defragging tip for Mac Steam gamers System
Mac OS X users have not needed the ability to defragment their hard drives. Most defragging is done in the background by the OS. There is one caveat: OS X does not defragment files larger than 20 MB. Quite often, many game files are easily larger than 20 MB. Fragmentation of game files will negatively impact performance of games, particularly FPS games.

Valve has included a defragmenter in the Steam client. Each game installed can be selected and right clicked to bring up the properties box. Once in the Properties box, select the Local Files tab and click Defragment Cache Files to begin defragmenting the game.

The author's blog has some screenshots of the process.

[crarko adds: I haven't tested this one. Here and here are some good discussions on the 'Hot-File-Adaptive-Clustering' method Apple uses in HFS+, and its effectiveness. On the whole it's been quite good. The 20 MB file size limit mentioned is one of the limitations, along with the number of extents used. I don't know if you still need to be wary of defragging a FileVault home folder, but I'd err on the side of caution and make sure I had a known good backup before trying it.]
  Post a comment  •  Comments (7)  
  • Currently 4.63 / 5
  You rated: 3 / 5 (8 votes cast)
[7,662 views] Email Article To a Friend View Printable Version