Exactly what did I do on September 3 between 3 and 3:15 pm?
September 21, 2008 4:19 PM   Subscribe

I'm looking for software for the Mac that logs open documents (and how long they are open). Does such a thing exist?

So it doesn't sound too espionage-y, here's what I need it for... I'm a graphic designer for a small firm and we don't log job times with timesheets. We enter time spent on a job bag that travels with the job through the shop. This doesn't work for me, for a lot of reasons, and it's easier at the end of the month to submit a big list of hours I spent on individual projects. However, at the end of the month there is always a day or two I didn't get down in my logs and I have to recreate missing days from searches.

So...any ideas?
posted by Mcable to Computers & Internet (6 answers total) 1 user marked this as a favorite
How about creating an entry in /System/Library/LaunchDaemons/ that runs "lsof" every 5 - 15 min. You can filter the output of lsof by various criteria, but the best idea is merely keeping all work files in /Work/[pojectname]. So say a perl script picks out lines matching \/Work\/([^\/]+)\/ and notes changes in /Work/$1/.timesheet. You can get the changes in various ways, including keeping your whole history of lsof in rcs, but I'd recommend just handling it in perl directly.

You could also start religiously using version control, but that isn't ideal if your working with images in compressed formats.
posted by jeffburdges at 5:11 PM on September 21, 2008

It seems like lsof +D /Work is faster than grabbing all open files.
posted by jeffburdges at 5:24 PM on September 21, 2008

lsof won't work on its own. An application may have a document window visible, but that doesn't mean that the application actually has the file open. More than likely the app will close the file after reading it into memory.

(Even worse, for some kinds of documents, the "document" may be made up of more than one file.)

A higher-level solution would be to use AppleScript to find all the open applications, ask each one for its document windows, and thus make a list of all the documents. I'd be surprised if someone hadn't written this already, but I don't know of an example...

(yes, I know the AppleScript solution will probably fail in lots of cases too, and won't notice that file you're editing in emacs in a Terminal window... nothing's ever as easy as it sounds, is it?)
posted by xil at 5:47 PM on September 21, 2008

Oops, yes, I see lsof won't give the desired information for all applications. Yes, you should query each open application for each open file using AppleScript. Well, I suppose using version control is the best option. I'd say use git for a stand alone system, but I'm not sure git is very nice about extracting dates.
posted by jeffburdges at 6:03 PM on September 21, 2008

Best answer: what about SLife?
posted by Chris4d at 7:43 PM on September 21, 2008

Response by poster: SLife is exactly what I'm looking for. Thanks!

Also thanks to jeffburdges, but I'm not that technical, I need a premade app.
posted by Mcable at 7:08 AM on September 22, 2008

« Older Allergy/EyeballFilter: What's the same in Japan...   |   Critical: How to fix MBR on Ubuntu/Vista dual-boot... Newer »
This thread is closed to new comments.