View Single Post
Here's a rough idea of how you might do something like this:

Code:
tell application "OmniPlan"
	tell front document
		set my_group to first resource where (resource type is resource group) and (name is "3 Stooges")
		my print_group(my_group)
		set my_resource to first resource where (resource type is person) and (name is "Bill")
		set my_count to number of assignments of my_resource
		display alert "Bill has " & my_count & " task(s) assigned"
	end tell
end tell

using terms from application "OmniPlan"
	on print_group(this_resource)
		if (resource type of this_resource is resource group) then
			set group_count to number of (child resources of this_resource)
			display alert "found a group named " & name of this_resource & " with " & group_count & " items"
			repeat with a_resource in child resources of this_resource
				print_group(a_resource)
			end repeat
		end if
		if (resource type of this_resource is person) then
			display alert "found a person named " & name of this_resource
		end if
		if (resource type of this_resource is equipment) then
			display alert "found equipment named " & name of this_resource
		end if
		if (resource type of this_resource is material) then
			display alert "found material named " & name of this_resource
		end if
		
	end print_group
end using terms from