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

Control Time Machine from the command line with tmutil System
The ability to control Time Machine from the Time Machine preferences in System Preferences is quite limited. You can choose exclusions, turn Time Machine on or off, and force backups, but that's about it. Fortunately, a command-line tool, tmutil provides much more control over Time Machine. The man page for tmutil says the following:

"tmutil provides methods of controlling and interacting with Time Machine, as well as examining and manipulating Time Machine backups. Common abilities include restoring data from backups, editing exclusions, and comparing back-ups."

For example, you can compare backups to see what has changed from one backup to another, inherit a backup (which you can do from the Time Machine menu, when you set up a new Mac and want to use a backup from an older Mac), or set up fixed-path exclusions (excluding items at a specific file path).

Check man tmutil to see all that you can do with this command.
  Post a comment  •  Comments (2)  
  • Currently 3.00 / 5
  You rated: 2 / 5 (12 votes cast)
[7,102 views]  View Printable Version
Back up your Contacts database automatically Apps
One problem with iCloud is once you delete a contact, it's gone for good. I wish that iCloud kept a copy of deleted contacts like Dropbox.

But you cane use Dropbox to save copies of your Contacts database. Make a symbolic link from your address book data to Dropbox. IF you accidentally delete that contact, go hunting in Dropbox.

Launch Terminal, type cd ~/Dropbox , then type:

ln -s /Users/username/Library/Application\ Support/AddressBook

where "username" is your user name.

If you ever accidentally delete a contact, you can go to the Dropbox website and find older versions of your Contacts database.

[kirkmc adds: Obviously, this hint is useful only for those who don't use Time Machine. But it also suggests a way to store backups of other key files.

In the AddressBook folder, you'll find the entire Contacts database (AddressBook-v22.abcddb), which you can restore, but, while it may include contacts you've deleted, it might not have new contacts you've added. There's also a Metadata folder, which contains cards for your contacts, which are used when you search with Spotlight. You can browse through these cards and, if you find a contact you've lost, double-click it to add it to Contacts.]
  Post a comment  •  Comments (14)  
  • Currently 1.92 / 5
  You rated: 1 / 5 (12 votes cast)
[6,726 views]  View Printable Version
Change the Notification Center sound System 10.8
I have to agree with Erica Sadun, at TUAW, who writes that Basso, the sound used by Notification Center, is horrid. It makes me cringe, and, because of this, I don't use sounds with Notification Center.

But Sadun found that you can change the Notification Center sound with a bit of a hack. If you go to ~/Library/Sounds and place a sound in AIFF format there, and name it Basso.aiff, Notification Center will use that sound. You'll need to run the following Terminal command to relaunch Notification Center (or restart your Mac):

killall NotificationCenter

You'll have a much better sound for notifications. I really think Notification Center should not only allow users to change the default sound, but also choose specific sounds for different applications, the same way you can choose a specific ringtone for different callers on iOS.
  Post a comment  •  Comments (4)  
  • Currently 3.42 / 5
  You rated: 1 / 5 (12 votes cast)
[5,983 views]  View Printable Version
Use a voice recording as iPhone ringtone Apps
Let's face it: ringtones are boring. And annoying. How many times do you want to hear the refrain from your favorite song when someone calls? And do you realize how annoying it is to others to hear a blasting bit of the latest Lady Gaga song.

On the other hand, using a default iPhone ringtone means that, if you're in a crowded area, lots of people will check their phones, thinking that they're getting a call, since they use the same ringtone.

If you want a change, you can use a voice recording as your ringtone. OS X Daily recently published a tip explaining how to do this. You record a voice memo, sync it to your Mac, change the extension, then sync it back.

This said, think twice about whether you really want to do this. Because a voice recording could be more annoying than music, to others.
  Post a comment  •  Comments (5)  
  • Currently 3.08 / 5
  You rated: 1 / 5 (12 votes cast)
[14,570 views]  View Printable Version
Keep iPhone silent except for selected callers iOS devices
The iPhone's Do Not Disturb setting (in Settings > Notifications) is a way to turn off rings, alerts and other sounds on your iPhone; it's great when you're in meetings, or in the movies.

However, you may want to not be disturbed and still want to be notified when you get calls from specific people. There's a way to do this, but it's a bit complex; a Stack Exchange member explained how to do it.

It involves creating a group for the person or people you want to "disturb" you in Contacts (either on your Mac or on; you can't do this on the iPhone), and selecting that group in Settings > Notifications > Do Not Disturb. You can choose to allow calls from Everyone, No One, Favorites, or specific groups. So you might have a few people set as Favorites, so you can call them quickly from the Phone app, but if you want to limit the rings to just one or two people, it's easier to create a group for them.

See the Stack Exchange post for details on creating groups in Contacts.
  Post a comment  •  Comments (4)  
  • Currently 3.57 / 5
  You rated: 1 / 5 (14 votes cast)
[16,872 views]  View Printable Version
Send and receive private messages from with OS X Messages Apps
You may be familiar with, a service designed to be an alternative to Twitter. Originally a subscription-only service, now has free tiers on an invitation-only basis. has an open API which allows developers to do interesting things. One of these is Project Amy, by Steve Streza which allows you to use Messages in OS X to send and receive private messages. If you use, you can download Project Amy here.
  Post a comment  •  Comments (1)  
  • Currently 2.75 / 5
  You rated: 3 / 5 (8 votes cast)
[3,594 views]  View Printable Version
AppleScript to change Sound preferences Apps
This hint updates this hint which provides an AppleScript that changes the sound input or sound output device selection.

I use Control Plane to manage various preference differences among the different locations (work, home, travel) where I use my MacBook. Control Plane uses various criteria (e.g., IP address, WiFi network name, etc.) to determine your location. Control Plane offers a lot of built in capability to change settings on your Mac based on arriving or leaving a location, and I recommend it highly if you regularly move your Mac among different working environments.

One capability that is not available in Control Plane is the ability to change Sound preferences when you move your Mac from one place to another. In my case, I have a Thunderbolt Display at work, which has built-in speakers and a built-in microphone. At home, I use my MacBook without a second display. I wanted to be able to change the Sound preferences back and forth using Control Plane.

Control Plane does offer the capability, however, to run any application when it detects that have arrived at or have left a particular location. So, you can run any AppleScript.

Relying on the hint comments here, I have updated the scripts in that hint to address my desire for changing sound preferences. My updated script should work on Lion and Mountain Lion. I cannot say whether it will work on earlier versions of OS X.

tell application "System Preferences" to activate
tell application "System Preferences"
	reveal anchor "input" of pane id ""
end tell
tell application "System Events" to tell process "System Preferences"
	tell table 1 of scroll area 1 of tab group 1 of window 1
		select (row 1 where value of text field 1 is "Internal microphone")
	end tell
end tell
quit application "System Preferences"

Note that this script hard codes the name of the Sound preferences pane tab to select and the sound input device to select. To set an output device, you would change "input" to "output" in the 3rd line of the script and then change the device name in the 7th line. I created separate scripts for sound input and sound output for each location where I work. I then simply created a Control Plane rule for each location for sound input and sound output separately.

  Post a comment  •  Comments (2)  
  • Currently 2.33 / 5
  You rated: 1 / 5 (9 votes cast)
[8,544 views]  View Printable Version
Add info after phone numbers in Contacts Apps
Placing a comma after a phone number in Contacts allows you to add useful information. Without the comma, any information after the number will prevent it from auto-dialing on the iPhone, not recognizing it as a phone number.

Before smart phones I often found it useful to add additional information after a phone number in a contacts database, such as an extension number (x123), person's name or initial (John or J), function (billing), etc. The template in Contacts does not have a field for Extension which would allow for this. In addition, with the iPhone, the number itself will not even assume the proper format (area code in brackets, 3 numbers, dash, 4 numbers) if there is any additional information after the number, and therefore you won't be able to dial the number.

Putting a comma after any phone number (read as a one-second pause, as with modems) allows for any such qualifying information to be added. For me this is much easier than creating hundreds of custom fields for phone numbers.
  Post a comment  •  Comments (14)  
  • Currently 3.73 / 5
  You rated: 1 / 5 (15 votes cast)
[11,004 views]  View Printable Version
Microsoft Word keyboard shortcut to close the sidebar Apps
Microsoft Word 2011 does not, as far as I can tell, offer a means of assigning a keyboard shortcut to close the sidebar. The AppleScript described here provides that functionality, and sets a keyboard shortcut that will trigger it.

Name the following Applescript "MicrosoftWordCloseSidebar\mosH.scpt" (notice the reversed slash) and save it in ~/Library/Application Support/Microsoft/Office/Word Script Menu Items:
do shell script "osascript -e '
tell application \"System Events\" to tell process \"Microsoft Word\"
 	set {frontmost, itemFound} to {true, false}
 	repeat with w in windows
 		tell w to repeat with g in groups
 			tell g to repeat with c in checkboxes
 				tell c to if value of its attribute \"AXHelp\" = \"Close the Sidebar\" then
 					set itemFound to true
 					exit repeat
 				end if
 			end repeat
 			if itemFound then exit repeat
 		end repeat
 		if itemFound then exit repeat
 	end repeat
end tell
' >/dev/null 2>&1 &"
When you press Command-Option-Shift-H, the close button of the sidebar is clicked, and the sidebar closes. The keyboard shortcut comes from the "mosH" part of the Applescript name (m=Command, o=Option, s=Shift, H=the letter H). That shortcut was chosen to complement the existing shortcut to open the Find/Replace Sidebar (Command-Shift-H) and may be altered to suit a particular user's needs. The script is constructed as a background osascript to get around a problem that occurs when trying to GUI-script Microsoft Word from its script menu.
  Post a comment  •  Comments (12)  
  • Currently 3.29 / 5
  You rated: 4 / 5 (7 votes cast)
[6,843 views]  View Printable Version
Flatten a directory structure UNIX
There may be times when you want to consolidate all the files in a directory and its sub-directories (or a folder and its sub-folders) into a single directory or folder. For example, you may have a folder with sub-folders for years, and other sub-folders in each year folder for months, and you may want to move files in the month folders all to the top level.

Doing this manually is a complex and time-consuming process. While you might be able to do this by using a search - for example, if all the files are, say, Excel files, you can search for Excel files in the top folder, then just copy them all to a new folder - if there are lots of different types of files, this wouldn't make things easier.

Fortunately, there's a way to do this from a command line. On the BedroomLAN blog, Alexios presents two commands that will do this:

find -type f -print0 | xargs -0 -I%%% cp %%% $FLAT_DIRECTORY

Replace $ROOT_DIRECTORY with the top level directory containing all the sub-directories and files, and replace $FLAT_DIRECTORY with the directory you wish to contain all the files. Note that this command will overwrite any files with the same name, so if you don't have uniquely named files, it's not ideal.

You can also use the ln command instead of the cp command, and this will not overwrite files, but will give error messages if there are duplicate file names. See the blog post for more details on this. H/t to robg for pointing this out.
  Post a comment  •  Comments (12)  
  • Currently 1.57 / 5
  You rated: 1 / 5 (7 votes cast)
[12,746 views]  View Printable Version