Time Tracking with @in-progress and iCal (plus GeekTool)

How it works

Let's say you want to start working on a task X, and for some reason you estimate the working time for X as one hour. Therefore, you assign @duration(1h) to X and run ToggleNow.scpt (assign a shortcut for this!). This adds @now to X and runs Clock.scpt, i.e. starts the clock (by adding a note with prefix CLOCK:... to X). Moreover, @in-progress will be assigned to X and to all ancestors of X (expect for those tagged as @off-progress).
If you get interrupted, while you're working on X, run Pause-Taskpaper.scpt (assign a global(!) shortcut!) or ToggleNow.scpt. The former marks X as paused by adding the value paused to @now yielding @now(paused), while the latter deletes @now from X. Additionally, both scripts stop the clock, make an iCal-event, and add the working-time to @in-progress. E.g, say you worked for one and a half hour on X. Then, after pausing, you have

X @now(paused) @in-progress(1h30m) @duration(1h) @exceeded

where @exceeded indicates that you have exceeded the expected working-time for X (i.e., @in-progress > @duration).
If you start working on X again, run Pause-Taskpaper.scpt which starts the clock and clears the value of @now. Now let's say you've finished task X. A convenient way to mark X as @done is to run Done-Taskpaper.scpt with a global shortcut, so you don't have to switch to TaskPaper and search for X (e.g., by invoking JumpToNow.scpt).

One more thing..

The default iCal-calendar, if X has no @ical tag assigned, is "taskpaper" (see Clock.scpt, variable theCal). However, if a tag @ical(name_of_cal) of X (and a corresponding calendar in iCal) exists, the working time for X, and all the successors of X, will be tracked in the calendar named "name_of_cal".
The threshold (min. minutes) for tracking in iCal is set to 3 minutes and can be changed in Clock.scpt (variable minMinutes).

Syntax and semantics of @in-progress and @duration

Now I'll explain the syntax of the values of @in-progress and @duration. First, we have the following "keywords" (defined in Clock.scpt and StartDueInProgress.scpt):
m … minutes
h … hours
d … days
w … weeks
x … months
y … years

A well-formed value is any string containing integers and keywords from above, starting with an integer and ending with a character. For example 1y2x2w3d, 1y1y1y, and 2y1w2y1d are all well-formed values. The integers corresponding to the same keyword are semantically summed up, i.e., 1y1y1y is equal to 3y and 2y1w2y1d is equal to 4y1w1d.
Clearly, 1h is equal to 60m. The semantics for the remaining keywords are defined as follows (see Clock.scpt):
1d (one day) = workingHoursPerDay
1w (one week) = workingDaysPerWeek

This means, you can define the amount of hours you approximately work per day and so on. For example, if you work 8 hours a day and 5 days a week, then 3d = 24h, and 7d = 1w2d.


I've extended the StartAndDueDates script to StartDueInProgress.scpt which correctly handles @in-progress and @duration, i.e. if @in-progress > @duration the script adds @exceeded to the corresponding task.
Additionally, I've implemented the following imho useful features:


GeekTool is a tool that lets you display information on your desktop. It is very easy to display the current task you're working on (i.e., the task tagged @now). For this, install GeekTool, drag a Shell-Geeklet to the desktop, choose a refresh rate, and write into the inputfield named "Command:" the following command (replace USERNAME by your username):

osascript /Users/USERNAME/Library/Scripts/Applications/TaskPaper/ShowNowTask.scpt

I didn't have the time to code more scripts, but it's fairly easy to create scripts that display the next tasks (next-action list) etc. on the desktop!



Done.scpt (a modified version of TagWithDoneAlternativeImplementations2)
NextActions.scpt (a modified version of NextActions)
StartDueInProgress.scpt (a modified version of StartAndDueDates)
Clock.scpt (a modified version of ClockInAndOutOfTasks)
Done-TaskPaper.scpt (assign global shortcut!)
Pause-TaskPaper.scpt (assign global shortcut!)
ShowNowTask.scpt (GeekTool)


I adapted the following themes which I extensively use and highly recommend:

To install a theme, save the taskpapertheme-file in

/Users/USERNAME/Library/Application Support/Taskpaper/Themes

Christian Antic (christian.antic@me.com)