View Single Post
Hi Lizard,
Say I have a custom field which is float (1.25) and I want to roll up/sum up the values of this custom field to its parent group, how do i do that.
By the way your script worked nicely to update the calculated field in custom data. Thanks



Quote:
Originally Posted by Lizard View Post
Here's Apple's official AppleScript reference:

I actually find Matt Neuberg's book AppleScript:The Definitive Guide (O'Reilly) more helpful.

Here's an example of an AppleScript that does approximately what I described above:
Code:
tell application "OmniPlan"
	repeat with t in tasks of front document
		if task type of t is standard task then
			-- effort is in seconds
			set budgetHours to (effort of t) / 3600
			set budgetPrice to value of custom data entry "Budget Hour Price" of t
			if budgetHours is missing value or budgetPrice is missing value then
				set budgetTotal to 0
			else
				set budgetTotal to budgetHours * budgetPrice
			end if
			set value of custom data entry "Budget Total" of t to budgetTotal
		end if
	end repeat
end tell