Maestro Monday: Backup OS X Contacts

This week’s Maestro macro is entirely self-contained, no Apple Script or external utilities needed. The macro exports the OS X Contact list (aka Address Book) to a file that can be imported later if it’s needed. The two restrictions are that the screen cannot be locked when the script runs and it can only be run once per day. The macro runs on Mavericks, it may need to be changed for earlier versions (for example, when “Contacts” was called “Address Book”).

I set this macro to be triggered only from the status menu. I have a regular weekly backup routine and run it at that time. While I prefer automated backup solutions, having to be at the computer to trigger isn’t a problem in this case. My weekly routing includes making sure the backups ran OK and this one runs so quickly it adds almost no time to how long it would take to verify the backup. Plus if I make a lot of changes I can easily do an immediate backup.

This script is one of the longer ones when measured by screen real estate. The process is straight-forward: Start contacts if needed, export the contacts using the export menu, change the location to where I want it and save the file, then quit contacts. There are some pauses in there to give the app time to respond.

The export command automatically includes the date in the file name so the file will have a unique name every day. If the macro is run twice in one day it will break. It will prompt to replace the file and the remaining shutdown command will be lost. This hasn’t been a problem for me so I haven’t taken the time to create a workaround.

Screen capture of macro to backup OS X contacts

Maestro Monday: Unmount Backup Drive

Last week I shared my macro for automatically mounting drives. This one also deals with drives but this time is to unmount (disconnect them).

I use SuperDuper! to clone my drives to an external USB drive as a bootable backup. SuperDuper! can schedule a backup to occur when a drive is connected to the Mac. But this leaves the USB drive mounted when the backup finishes. I wanted to completely automate the process so all I had to do was connect the USB drive to start and disconnect it when it was done.

To do this SuperDuper! must be configured to quit when the backup is done.

Screenshot of SuperDuper settings

A short Apple Script is also needed for this and will be the following script with “BackupDrive” replaced with the external drive name as it appears in the Finder sidebar.

tell application "Finder"
    eject "BackupDrive"
end tell

I have one script that covers all my Macs and all the external drives I use for backups. The script unmounts any drives it find mounted when SuperDuper quits.

Here’s the Keyboard Maestro script.

The Keyboard Maestro script


Apple OS X Mavericks 10.9.3 Released

Apple released OS X 10.9.3 today.

This update:

  • Improves 4K display support on Mac Pro (Late 2013) and MacBook Pro with 15-inch Retina Display (Late 2013)
  • Adds the ability to sync contacts and calendars between a Mac and iOS device using a USB connection
  • Improves the reliability of VPN connections using IPsec
  • Resolves an issue that prevented Font Book from installing PostScript Type 1 fonts
  • Improves reliability of copying, editing and inspecting permissions of files on an SMB file server
  • Improves reliability of network home directories
  • Improves stability when installing configuration profiles
  • Improves login speed for users in Active Directory groups
  • Includes Safari 7.0.3

No info on the security content yet.

I updated my Mac Mini without any immediate issues. I’m waiting a day or two before updating my MacBook.

Maestro Monday: (Re)Mount Drives

Keyboard Maestro is fairly new to me but I’ve already put it to good use. One annoyance I had is having to remount server drives. Sure, I could automatically mount them at login but the connection could be lost, such as when the server rebooted. Enter Keyboard Maestro. I have a script that runs when I logon, when I select it from the menu, and every hour if I’m logged on.

A small bit of Apple Script is needed to actually mount (connect to) the drives. The address for the drive is also needed. I use SMB for the connections rather than AFP (Apple Filing Protocol) but the procedure for getting the connection string is the same, it will just look different than the screenshots. The screenshots are from OS X 10.9.2 Mavericks and Keyboard Maestro 6.4.1. It doesn’t really matter, but my “Server” drives are on a Windows Home Server 2011 box and a Synology NAS.

To get the connection mount the drive manually then do a “Get Info” in Finder. Get the “Server” information under general information.

Since the Apple Script does the real work I could use other utilities or schedulers. But Keyboard Maestro seems like a good place to centralize this and it makes it easy to create the logic.

screenshot of the Get Info screen for the drive

The snippet of Apple Script is shown below along with the info from above:

tell application "Finder"
        mount volume "smb://user@osqwhs02/Archive"
    end try
end tell

Note that the user name has to be added to the mount volume command as shown by user@ in the above example. My password is saved in the Mac’s keychain otherwise it would need to be included in the Apple Script.

All this gets put together in a Keyboard Maestro macro:

Keyboard Maestro macro to mount drives

The macro checks to see if the drive is mounted and if it is not then it runs the Apple Script.



Recommended Utility: Contacts Cleaner for OS X

In a recent quest to get organized I decided to clean up my contacts. This is always scary for me since I usually delete something or worse, not notice some of this info is wrong or deleted. So before doing anything I made backups of all my contacts book.

Since I’m organizing my PC life around a Mac, and no longer trying to co-exist between Windows and OS X I decided to consolidate my contact information to OS X Contacts (formerly Address Book). My contacts were spread out between Contacts, People in and Google Mail. Since I have an iOS device it was pretty simple to move all my contacts to OS X Contacts. But this did create some duplicates. Plus I had multiple entries with badly formatted data.

Contact Cleaner from Spanning Sync Inc. is a $5 app available from the Mac App Store. I don’t really want all my contacts in screenshots so they’re limited but the screen shot below shows the type of problems Contact Cleaner will find. You can turn off the scan for any problems you don’t want Contact Cleaner to fix.

Screenshot showing the problems that can be foundI had a lot of duplicates and businesses not set to display as a company. I also had a lot of badly formatted phone numbers but for me this was less of a concern.

The screenshot below shows the screen that displays after the scan is done.

Screenshot of contact cleaner resultsI have the option of having the app automatically fix all conflicts, I can process them one by one, or I can open Contacts to deal with it.

Contacts Cleaner is one of those utilities which performs the biggest benefit the first day it is run so there’s no demo. After that first run there are fewer problems to find (hopefully). But it earned the $5 the first day I used it since it saved me so much time.