View Single Post
Quote:
Originally Posted by Tom Bunch

Code:
tell application "OmniPlan"
	set frontWindow to front window
	set frontDocument to document of frontWindow
	set oldVisibleColumns to {} & task columns of frontWindow
	set task columns of frontWindow to {"Title", "Total Cost", "Effort", "Planned End"}
	tell frontDocument
		save in "Volumes:Extra:myReport.htmld" as "HTML Full Report" with properties {export template:"Users:tom:Library:Application Support:OmniPlan:HTMLTemplates:Custom Project Report"}
	end tell
	set task columns of frontWindow to oldVisibleColumns
end tell
Note that in the next release, there will be a new export command that will replace "save in", above, which will no longer support "as" or "with properties". This will be your new line, then:

Code:
export to "Volumes:Extra:myReport.htmld" as "HTML Full Report" using template "Users:tom:Library:Application Support:OmniPlan:HTMLTemplates:Custom Project Report"
The identifiers of all columns are documented in the AppleScript dictionary for OmniPlan. There are lots of ways this script could go, but hopefully this will get you started.

-Tom
Is it possible to specify in the applescript the export options? For example I would like to export only tasks matching any of Urgency is this task is due soon, Urgency is this task overdue and Urgency is this task due in less than 1 day.