Guest
2011-01-12, 08:19 AM
A simplified (non-recursive) framework might look like the code below
(I have also sketched a couple of the statistical amendments)
Code:
set {strDelim, text item delimiters} to {text item delimiters, return}
-- LIST YOUR LABELS AND THEIR DEFINITIONS
tell application id "com.omnigroup.omnifocus"
tell default document
set strResults to {¬
"Actions, excluding action groups: " & (do shell script "sqlite3 ~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2 'select count(*) from task where (projectinfo is null) and (childrenCount=0)';"), ¬
"", ¬
"Active Folders: " & (count of (flattened folders where its hidden is false)) as string, ¬
"Dropped Folders: " & (count of (flattened folders where hidden is true)) as string, ¬
"", ¬
"Various other categories, and their counts", ¬
"...", ¬
"etc.", ¬
"", ¬
"Pending projects: " & (count of (flattened projects where singleton action holder is false and status is active and ¬
((its folder is missing value) or (effectively hidden of its folder is false)) and its start date > (current date))) as string ¬
} as string
end tell
end tell
-- AND OFFER THE RESULTS TO THE USER
display dialog strResults buttons {"Definition Cookbook", "Copy", "OK"} default button {"OK"} with title "No need for recursion ..."
set btn to button returned of result
if btn is "Copy" then
set the clipboard to strResults
else if btn is "Definition Cookbook" then
do shell script "open " & quoted form of "http://forums.omnigroup.com/showthread.php?p=84886#post84886"
end if
set text item delimiters to strDelim
Last edited by RobTrew; 2011-01-12 at 09:14 AM..