Musings about technology and other neat stuff

BrT random header image

How to use Things on two accounts on the same machine

May 23rd, 2008 · No Comments

I am a big fan of Things, the very nice task manager from Cultured Code. I keep both personal and work-related tasks in it, and in my Mac I have two accounts, for personal and work-related use. This leads to me having to run Things on both accounts, while sharing the same database. Here’s how I do it:

  • In one of the two accounts, I created a symlink from ~/Library/Application Support/Cultured Code into the corresponding directory of the other account (my two accounts are named “dza” and “zamboni”, and I created the symlink in “zamboni”:
    zamboni% cd Library/Application\ Supportzamboni% ln -s ~dza/Library/Application\ Support/Cultured\ Code .

    This makes Things access the same files regardless of which account uses it.

  • Make sure that both accounts can read and write from that directory. In my case, both my accounts belong to the “staff” group, so I simply give the files group-write permissions (you have to do this from the account where the original files are, or from root):
    dza% chgrp -R staff ~/Library/Application\ Support/Cultured\ Codedza% chmod -R g=u ~/Library/Application\ Support/Cultured\ Code
  • You have to make sure Things is only run from one account at a time, to avoid them overwriting each other’s changes. To automatically achieve this, I wrote a small script that kills Things if it’s being run by someone else and then runs it in the current account. Simply killing the process is a bit crude, but Things seem to process the signal properly, I have never lost any data by doing this. Here is the script (I saved it as /usr/local/bin/things_launcher):
    #!/bin/bash# If it's running as any user other than me, kill itif ps axuwww | grep Things | grep -v "^$USER"; thensudo killall Thingssleep 1fi# Now run or activate itopen -a Things

    (note: this will only work if you have set up sudo on your machine to execute commands without asking for your password – I am still figuring out how to use the standard authentication dialog in OSX)

  • Now for the final touch, I used Platypus to create an Application wrapper around my script, so that I can run it using Quicksilver. I named it “Things wrapper”, and you can download it here (or you can create your own using Platypus). I gave it the Things icon, but maybe someone with more artistic talent can come up with a better, more representative icon…
  • That’s it! Just run “Things wrapper” instead of Things, and it will automatically kill other copies of Things, and run it in the local account. If you have it already running, it will simply activate it.

If you find this useful, or if you have any feedback, I would love to hear about it.

Tags: · · ·