View Single Post
Nice work. A couple of thoughts:

Your total action count is probably not quite right - you are taking the total number of records in the task table, but a significant proportion of these records are actually projects rather than tasks.
(Of those that remain, some are actions and some are action groups. For some purposes it may be helpful to count these separately).

(For an approach which separately counts actions, action groups, and inbox actions, see, for example: Script for a Quick listing of OmniFocus Statistics

Your useful addition of a Pending statistic may also need adjusting to take account of folder status. OmniFocus does not treat projects as pending if their folder (or any ancestral folder) is dropped.

Your whose clause could therefore be expanded to something like:
((singleton action holder is false) and (status is active) and (start date > now) and ((effectively hidden of its folder is false) or (its folder is missing value)))
(See Draft FAQ: OF 1.8 Filter options and their search-language equivalents)

Finally, a small programming point which might allow some simplification and a slight gain in speed - as of Ver 1.8 we no longer need to recursively walk the object trees - you can get your stats directly by applying the where/whose conditions directly to collections such as flattened folders, or flattened projects of the default document.

Rob

--

Last edited by RobTrew; 2011-01-12 at 11:07 AM..