Synchronize and backup Address Book contacts with Dropbox

A nice way to synchronize contacts between your Macs without having to buy a MobileMe account is to have them on your Dropbox.

Basically, it boils down to moving the folder containing your Address Book data on your Dropbox, then adding a symbolic link to it so Address Book will know where to find its data.

Let’s go on bash!

Move the folder:

$ mv -v ~/Library/Application\ Support/AddressBook ~/Dropbox/

Add a symbolic link:

$ ln -s ~/Dropbox/AddressBook/ ~/Library/Application\ Support/AddressBook

Done!

Now you’ll only have to add the symbolic link to every Mac you want to synchronize (you may also need to remove the existing AddressBook folder). Another awesome consequence is that you don’t have to worry about losing your contacts if your hard drive crashes: they’re safe in your Dropbox.

A word of advice though: Address Book was not originally meant to be used this way. It would be wise not to edit your Address Book from the two computers are the same time, for example.

Application icons

Just a quick follow-up to this post about changing application icons:

  • Someone actually found this post by Googling for “creepy preview icon osx”. I love it. :D
  • You can find an astonishing number of great icons on DeviantArt. There is actually a whole category for Mac OS X icons, and given DeviantArt usual level of quality, most of these are insanely good.

Hats off to this nifty little customization for nostalgic users by the way. Not an icon stricto sensu, but definitely lovely.

Alfred – it’s like Quicksilver, but better

I recently started to use Alfred, first along Quicksilver, then as a full replacement. For those of you who never used any of these two, they act like Spotlight on steroids: invoke them with a shortcut, type in a few letters, and let the fun begin. Quicksilver lets you do the basics (launch programs, open folders…) and way, way more.

A simple example? You can type a picture name, then use Quicksilver to resize it at your will, then re-invoke Quicksilver to send it to someone in your Address Book. That’s already pretty impressive, but the amazing part is being able to do it all from the keyboard. Command-line gurus (and to be honest, even command-line regular users :) ) know that using the mouse is usually a waste of time.

Quicksilver bezel interface
Quicksilver bezel interface

However, Quicksilver development seemed to have stopped. Blacktree, QS developers (check out Nocturne, it’s awesome!), hasn’t given any sign of life for quite some time. Some development seems to be going on on GitHub, but nothing ground-breaking.

Considering I don’t use most of Quicksilver’s possibilities, and that I felt QS was getting slower and slower (an index-related issue maybe?), I tried Alfred.

Alfred interface
Alfred's interface (hat disabled). Hello minimalism!

Alfred is fast. Blazing fast. It’s especially impressive on a MacBook Air, with its slow-ish processor and sluggish hard drive.

Considering I use it often to launch programs and web searches (you can add you own search engines), the speed improvement is what sold me. Check it out!

A keyboard shortcut to change files colours in the Finder?

My usual habit (some would call it an intermittent OCD, but meh) of sorting and organizing files and folders to a great extend and my almost as severe relentless longing for optimisation recently met in an existential question: is it possible to colour files in the Finder through a keyboard shortcut?

OS X lets you add colours -or “labels”– to a file by right-click or in the Finder’s File menu. GUI are cool, but get in the way of efficiency once you know your keyboard inside and out.

Well, after some research, it seems that such a shortcut does not exist. You can’t even create a shortcut the usual way, as the “Label” menu point stands for all labels. (I’ll eventually describe the usual method in this blog!)

The simplest way to implement such a feature was to create a set of AppleScripts that colour files that are currently selected, and launch them via the most amazing QuickSilver. Or Alfred. Or even Spotlight.

The AppleScripts look like that:

property file_color : 5
-- replace '5' above with the number for the color you'd like to use:
-- 0=none, 1=orange, 2=red, 3=yellow, 4=blue, 5=purple, 6=green, 7=grey 

tell application "Finder"
	activate
	set items_ to selection
	repeat with item_ in items_
		try
			set label index of item_ to file_color
		on error e
			display dialog e
		end try
	end repeat
end tell

This is the purple one. Therefore, I called it scp_SetColourPurple.scpt and dropped it off somewhere QuickSilver indexes – proceed this way for each colour you want to add.

All it takes now to colour a set of files is to select them in the Finder, type in Ctrl+Space (to summon QuickSilver) and the three letters to your colour of choice – scp to set the coulour to purple, scr to set colour to red, scy to set colour to yellow…

(Full disclosure: the above code was originally found somewhere on the internet, I can’t find where right now. If I find the link again, or if someone can point it to me, I’ll give props to the original author.)

Seitunes 1.0

Seitunes v1 is here! I think everything I need it to do is in here. I’m not planning on adding new features in the near future – if anything, I’ll concentrate on optimizing performance.

Sei what?

Seitunes is a command-line interface for iTunes.

It allows you to see what’s playing in iTunes and control it (play, pause, set volume, toggle shuffle, select a playlist, set song rating) from your terminal.

Overview of v1.0

I finally decided to split the program in two separate parts.

libseitunes.(c|h) is a C API to access iTunes through Applescript calls. It is also under GPL.

Seitunes.(c|h) is the higher-level part of the application, which is now completely Applescript-free.

New Features

Support for rating (display and modification).

Playlists: Seitunes now displays the playlist currently playing. You can also see all available playlists, and select the one you want to play (with ‘/’).

Bug fixes

A bug caused Seitunes to think iTunes was completely stopped (hence not displaying data about artist and song) if you went to next track whilst playback was paused. iTunes actually reports such a condition as “stopped”, so I added some code to handle this case (it basically checks if there is a “current track”, and if so, displays the data).

GitHub

Seitunes is now on GitHub!

MeWare?

I’ve stumbled upon this very interesting blog post by Eric Sink, classifying software into three big categories: ThemWare (someone writes software, only other people use it), MeWare (someone write software, only he uses it) and UsWare (someone writes software, he uses it and other people do so).

I have currently no idea if anyone else uses Seitunes, or even downloaded it once to see. If you do use it, I’d be delighted to hear from you!