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

Match system boot disc to Time Machine system before restore System
I was upgrading the hard drive in my MacBook Pro, so I started by making a Time Machine backup of my existing drive, which is running 10.6.2. After installing the new drive, I went to boot off my Snow Leopard disk. I couldn't find it, so I booted my machine from the original restore DVD (10.5), and did a 'Restore from Time Machine backup' using that installer. Three hours later, the machine rebooted from the new hard drive to an instant kernel panic.

I then found and used the 10.6 upgrade DVD to boot and do the restore again, and it worked flawlessly.

So, save yourself a matter of hours (plus a hefty amount of frustration!), and use the appropriate install DVD to restore your Time Machine backups!
  Post a comment  •  Comments (10)  
  • Currently 2.94 / 5
  You rated: 5 / 5 (16 votes cast)
 
[10,666 views] Email Article To a Friend View Printable Version
Create global tab-changing keyboard shortcuts System
In OS X, you can change Spaces, apps, and windows with the keyboard. What's missing? An easy way to globally navigate tabs in a Web browser, Terminal window, or other tabbed program. Many programs come with a keyboard shortcut to change tabs, but they vary by program and are frequently hard to reach. The solution: use System Preferences to change the shortcut to a single, easy-to-reach command for all programs.

I'll go through the steps of creating a shortcut for Apple's Safari browser. Other programs work the same way.
read more (364 words)   Post a comment  •  Comments (16)  
  • Currently 2.90 / 5
  You rated: 3 / 5 (20 votes cast)
 
[18,751 views] Email Article To a Friend View Printable Version
Force Folder Actions to notice changed files System
One of the challenges in my new career at Many Tricks is that Peter Maurer is located in Germany, while I'm here in the USA. I wanted to find a way to provide him with updated sales and expense reports without jumping through a lot of hoops. I decided on a private web page on our site, using Excel 2008's built-in "save as a web page" feature.

While Excel doesn't build the prettiest source HTML pages, the end result looks very much like the source page in Excel, which was fine for our needs. Excel even includes an automation feature that saves the web files each time you save the master worksheet. With that set up, I had an always-updated local copy of the financial report.

To automate putting this new page on the web, I turned to Folder Actions, and wrote a simple script to use scp to upload the files in my Sales Report folder. After attaching the script to the folder, I quickly discovered a key limitation: Folder Actions only 'see' new files being added to a folder; they don't seem to notice if you just update an existing file. So my slick script was useless, because the changed files weren't being updated.
read more (290 words)   Post a comment  •  Comments (21)  
  • Currently 2.71 / 5
  You rated: 2 / 5 (17 votes cast)
 
[11,232 views] Email Article To a Friend View Printable Version
Set Dock auto-hide state via AppleScript System
There are dozens of hints that programatically toggle the Dock's auto-hide state. Some suggest modifying com.apple.Dock, then killing the dock. Others rely on sending keystrokes to merely toggle the dock state.

Neither of these give the user elegant control over the state of the dock. So, I've written a small snippet of AppleScript combining these ideas, giving absolute control over the Dock's hiding state without killing the dock or modifying the plist. This is suitable for use in any situation where you want to allow the user to control the Dock's visibility state in your AppleScript code:
set weWantToHideTheDock to true

set currentDockHiddenState to (do shell script "defaults read com.apple.Dock autohide")

if (currentDockHiddenState is equal to "0") and (weWantToHideTheDock) then
  tell application "System Events"
    keystroke "d" using [command down, option down]
  end tell
else
  if (weWantToHideTheDock is false) and (currentDockHiddenState is equal to "1") then
    tell application "System Events"
      keystroke "d" using [command down, option down]
    end tell
  end if
end if
Your script will need to set weWantToHideTheDock. If set to true, the Dock will switch to auto-hide mode; setting it to false will disable auto-hiding. It's not a toggle, so if the Dock is already hidden and weWantToHideTheDock is set true, the Dock will stay hidden.

[robg adds: The above code isn't necessarily meant to be used as a standalone solution -- clearly it's much simpler to just press Command-Option-D if you want to toggle your Dock's visibility state. Instead, it's a snippet of code for use in larger programs.]
  Post a comment  •  Comments (4)  
  • Currently 3.57 / 5
  You rated: 5 / 5 (14 votes cast)
 
[10,811 views] Email Article To a Friend View Printable Version
Secrets of the proxy icon in a program's title bar System
You can perform many useful tasks using the icon in the title bar of many OS X applications (known as the proxy icon), in both Apple-bundled (TextEdit, Preview, etc.) and third party (BBEdit, Path Finder, and numerous others) applications.

For this to work, you need to be using a file that has had its latest changes saved (otherwise, the icon will be grayed out). Normally, when you click-and-drag on the title bar of a window, you just drag the window around. However, if you click-and-hold directly on the proxy icon, and optionally add a modifier key, you can access other useful functions. Here's what happens in most applications, including TextEdit and Preview:
  • Drag icon: If you drag the proxy icon to a Finder window or your Desktop, an alias to the open file will be created at the location where you drop the icon.
  • Option-drag icon: Hold down the Option (Alt) key prior to dragging, and you'll create a copy instead of an alias.
  • Command or Control: Displays a pop-up menu of the folders that contain the open file. Select one of the entries to open that folder in the Finder. (You can use this one on either the proxy icon or the window title immediately next to the icon.)
[robg adds: These features have been in OS X for many many years. We've covered copy (relative to Preview, at least) and path in the past, but not the straight drag of the icon, at least that I could find. Given the information was scattered in a couple hints about specific apps, I thought I'd use this chance to create a new consolidated summary version.

Note that third party apps may behave differently. In my limited testing, Path Finder behaved like TextEdit, but BBEdit does a move of the file if you just drag the icon; you need to Command-Option drag the proxy icon to create an alias. Please add comments for other non-normal behaviors in apps that I didn't test.]
  Post a comment  •  Comments (18)  
  • Currently 3.25 / 5
  You rated: 5 / 5 (20 votes cast)
 
[10,397 views] Email Article To a Friend View Printable Version
Set incredibly precise volume levels using AppleScript System
Mac OS X's default volume control hot keys change the volume in huge steps, but you can use Shift-Option and the Volume Up or Down keys for quarter-step changes (see this hint).

Still not fine enough for you? AppleScript to the rescue, once again. Though it has some oddities, AppleScript can be used to set the volume based on an entered number.

Here's the first quirk: the number of squares filled in on the HUD will be twice the number you typed in. So, typing set volume 1 sets the volume to level two. (There are 16 squares total, so you can enter a number from 1 to 8). You can use decimals to set the volume by individual square, too: set volume .5 fills in one square. You can, amazingly, extend this functionality to even greater levels of precision.

Want to set the volume to three and one-fifth squares (i.e. 3.2)? Type set volume 1.6 and click Run. The number is doubled, and the volume is set. Two and one one-hundredth squares (2.01)? Type set volume 1.005. You can get as precise as you want, as you can see.

I wrote a script to first cut the entered number in half, then set the volume based on that value. Here it is:
display dialog 
  "Enter number." with title 
  "Number Of Squares?" buttons {"Set"} 
  default button 1 default answer ""
set numberSquares to text returned of result
set numberHalved to numberSquares / 2
set volume numberHalved
[robg adds: This worked as described in 10.5 and 10.6.]
  Post a comment  •  Comments (9)  
  • Currently 2.71 / 5
  You rated: 2 / 5 (17 votes cast)
 
[16,496 views] Email Article To a Friend View Printable Version
Use PhotoBooth / iSight camera as a mirror System
I had never thought of using my Mac in this way, but thought it was a good use of a computer in an unusual way.

Yesterday I had gone to talk to a co-worker who was getting ready to head out the door for lunch. Rather than take out a compact, or find a mirror with which to check her hair, she just fired up PhotoBooth and used it as a mirror.

[robg adds: I've had this on sitting in the queue for a while, just waiting for a quiet hints day on which to run it...and that day is today. It will be interesting to see how many have done something similar -- personally, I never would have thought about doing this, mainly because I avoid mirrors whenever possible :).]
  Post a comment  •  Comments (16)  
  • Currently 2.15 / 5
  You rated: 2 / 5 (26 votes cast)
 
[13,420 views] Email Article To a Friend View Printable Version
Recover missing-but-there Time Machine backups System
Yesterday, I had problems restarting my Mac mini, so I booted off an external hard disk with a clone, and fixed the startup problem. This morning, I needed to find a file in my Time Machine backup, but all my backups prior to the moment I booted from the external disk were dark in the Time Machine timeline (at the right of the screen). In the Finder, I could only access those created since last night.

The backups were still there, though, and the Time Machine System Preferences pane recognized the date of my first backup as the oldest backup on my Time Machine disk.

I searched for solutions, and found none. Then I recalled an older hint about browsing other Time Machine backups by holding down the Option key while clicking the Time Machine icon in the menubar. So I tried that.

Only the one Time Machine disk showed up, and I selected it, and was able to access all my backups in the Time Machine interface. I left Time Machine and went back to the Finder. When I entered Time Machine from there, all my backups were now accessible, with the exception of the three oldest. I don't know why they all didn't come back, but at least I got most of them back. So if your Time Machine backups have entered a missing-but-there state, try the Option key solution to get them back.
  Post a comment  •  Comments (4)  
  • Currently 3.20 / 5
  You rated: 1 / 5 (25 votes cast)
 
[21,657 views] Email Article To a Friend View Printable Version
Make a folder read-write for all users without using ACLs System
People often want to share a folder on their startup drive (or another drive with ownership enabled) between several local users. It's easy to change permissions on the whole folder, but any newly created files inside that folder will only be writable by the user that created them.

A standard way of dealing with this issue is by using inherited ACLs as described in this hint. However, that method has a couple of drawbacks. Namely, some applications like Open Office don't understand ACLs. Other applications use temporary files when saving files that can wash out the ACLs, depending on particular setup. That includes, for example, Photoshop which strips off ACLs on re-saves. Lastly, inherited ACLs are only applied to newly created files and files copied to the shared folder. They are not applied to files moved to the shared folder. The proposed method of sharing a folder has no such deficiencies. It works in 10.5 and 10.6.

The trick is to mount a local folder on the same computer via NFS.
read more (407 words)   Post a comment  •  Comments (16)  
  • Currently 2.78 / 5
  You rated: 5 / 5 (23 votes cast)
 
[20,139 views] Email Article To a Friend View Printable Version
10.6: Move and resize app windows via AppleScript System
Snow Leopard only hintConcerning the Finder move/resize scripts from this previous hint, there are some issues in Snow Leopard (and perhaps Leopard).

When resizing a window, it will usually not go beyond the edge of the Dock. Even when the Dock is hidden, there will still be a four-pixel gap between the window and the display's edge. This will cause some of the previous scripts to fail. (They'll keep trying to place the window's edge beyond the system's tolerance).

I've updated the scripts to deal with this. You can get them here.
read more (188 words)   Post a comment  •  Comments (0)  
  • Currently 2.40 / 5
  You rated: 3 / 5 (15 votes cast)
 
[10,748 views] Email Article To a Friend View Printable Version