The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
How many tasks in my database? Thread Tools Search this Thread Display Modes
There's got to be an easy way to pull up a summary of how many tasks and how many projects I have. Can somebody point me in the right direction?
 
Quote:
Originally Posted by mpw View Post
a summary of how many tasks and how many projects I have.
Some variant of a simple Applescript on the toolbar would be one route:

Code:
tell application id "com.omnigroup.OmniFocus"
	tell default document
		display dialog 
			((((("All Folders: " & (count of flattened folders) as string) & return & 
				"All Projects: " & (count of flattened projects) as string) & return & 
				"All Tasks: " & (count of flattened tasks) as string) & return & return & 
				("Active projects: " & (count of (flattened projects where status is active)) as string) & return & 
				("On-Hold projects: " & (count of (flattened projects where status is on hold)) as string) & return & 
				("Completed projects: " & (count of (flattened projects where status is done)) as string) & return & 
				("Dropped projects: " & (count of (flattened projects where status is dropped)) as string) & return & return & 
				"Inbox tasks: " & (count of (inbox tasks)) as string) & return) 
				buttons {"OK"} with title "Default document"
	end tell
end tell
--

Last edited by RobTrew; 2010-09-30 at 01:41 AM..
 
Perfect, thanks RobTrew!
 
Counting how many tasks remain (and how many are completed) can take a few seconds (depending on the database), but could be added as an option like this:

Code:
property pCount : "Count Remaining & Completed tasks"
tell application id "com.omnigroup.OmniFocus"
	tell default document
		set lngTasks to count of flattened tasks
		set lngFolders to count of flattened folders
		set lngDropped to count of (flattened folders where effectively hidden is true)
		set strReport to 
			((((((("All Folders: " & lngFolders as string) & return & 
				"All Projects: " & (count of flattened projects) as string) & return & 
				"All Tasks: " & lngTasks as string) & return & return & 
				"Active folders: " & (lngFolders - lngDropped) as string) & return & 
				"Dropped folders: " & (lngDropped) as string) & return & return & 
				("Active projects: " & (count of (flattened projects where status is active)) as string) & return & 
				("On-hold projects: " & (count of (flattened projects where status is on hold)) as string) & return & 
				("Completed projects: " & (count of (flattened projects where status is done)) as string) & return & 
				("Dropped projects: " & (count of (flattened projects where status is dropped)) as string) & return & return & 
				"Inbox tasks: " & (count of (inbox tasks)) as string) & return)
		set varResponse to display dialog strReport buttons {pCount, "OK"} with title "Default document"
		if button returned of varResponse is pCount then
			-- display alert "Counting ..." giving up after 1
			set lngCompleted to count of (flattened tasks where completed is true)
			set lngRemaining to lngTasks - lngCompleted
			display dialog (strReport & return & 
				"Remaining tasks: " & lngRemaining as string) & return & 
				"Completed tasks: " & lngCompleted as string 
				buttons {"OK"} with title "Default document"
		end if
	end tell
end tell

Last edited by RobTrew; 2010-09-30 at 03:33 AM.. Reason: Added count of active and dropped folders
 
There is now a fuller and much faster script for OF database statistics on the OmniFocus Extras forum.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
repeating projects/tasks when all tasks/subtasks are complete? djc225 OmniFocus 1 for Mac 1 2012-03-20 06:55 PM
How to set up a new database? lorew OmniFocus 1 for Mac 4 2011-06-22 10:20 AM
"database on your iPhone is incompatible with the sync database" error message kevinwest66 OmniFocus Syncing 36 2011-05-08 03:32 PM
Why is my database so big? wdiadamo OmniFocus 1 for Mac 4 2009-01-07 08:59 AM
How big is too big for a database? malisa OmniFocus Syncing 6 2008-09-21 10:02 PM


All times are GMT -8. The time now is 11:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.