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 Extras
FAQ Members List Calendar Today's Posts

 
Omnifocus weekly report script.... Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Quote:
Originally Posted by Lizard View Post
The script is available over here.
A few quick thoughts about this very useful script:
  1. It seems to fetch the note data, but doesn't put it into the report. Was that the intention ? (It would certainly speed it up a bit to elide the fetching of note data, which can be quite slow).
  2. Since OF ver 1.8, the introduction of the flattened tasks property has made it possible to write these things rather more easily and briefly (and with noticeably faster execution - see the illustrative sketch below).
  3. The list comes out unsorted. This could be fixed by querying the cache rather than the applescript library, and using an ORDER BY statement in the SQL.

Note also that I have added a clause to exclude completed items from the Next Week list. (More generally, I am a little unclear about the intended role of the modification date conditions in the Last Week list - intuitively I might have expected this to have been defined in terms of the completion date).

Code:
property pstrSubject : "TPS Report"
property pstrGreeting : "Boss Name
"
property pstrThisWeek : "Here's what I did this week:
"
property pstrNextWeek : "Here's what I plan on doing next week:
"

property dteNow : current date
property dteHistory : dteNow - (7 * days)
property dteFuture : dteNow + (7 * days)

tell application "OmniFocus"
	activate
	tell front document
		set refHistory to a reference to (flattened tasks where (in inbox = false and its modification date > dteHistory))
		set refFuture to a reference to (flattened tasks where ¬
			(in inbox = false) and (completion date is missing value) and (modification date < dteHistory) and (due date > dteHistory) and (due date < dteFuture))
	end tell
	
	set {lstHDate, lstName} to {modification date, name} of refHistory
	repeat with i from 1 to length of lstHDate
		set item i of lstHDate to short date string of item i of lstHDate & space & item i of lstName
	end repeat
	
	set {lstFDate, lstName} to {modification date, name} of refFuture
	repeat with i from 1 to length of lstFDate
		set item i of lstFDate to short date string of item i of lstFDate & space & item i of lstName
	end repeat
end tell

set text item delimiters to return
set strMsg to (pstrGreeting & "
" & pstrThisWeek & "
" & lstHDate as string) & "

" & pstrNextWeek & "
" & lstFDate as string
set text item delimiters to space

tell application "Mail"
	tell (make new outgoing message with properties {visible:true, subject:pstrSubject, content:strMsg})
		make new to recipient at end of to recipients with properties {name:"Boss", address:"the_boss@megacorp.com"}
	end tell
	activate
end tell

Last edited by RobTrew; 2011-02-07 at 02:22 AM..
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
OmniFocus 2.0 Progress Report Nigrini OmniFocus 1 for Mac 58 2013-01-06 11:03 AM
Take Export from OmniSync for Omnifocus and create report? JonSingh OmniFocus Extras 0 2012-08-06 02:02 PM
Trying to create a weekly report Finlay Boo OmniFocus Extras 8 2012-04-26 12:50 AM
Extracting/Exporting for SIMPLE Weekly Report egrFocused Applying OmniFocus 0 2010-11-01 07:24 AM
Omnifocus report template for iWork Numbers '09? signal15 OmniFocus 1 for Mac 1 2009-04-21 12:59 PM


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


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