View Single Post
In addition to the above problem, I am trying to get a count of number of tasks assigned to a specific resource. I have a schedule of 9 tasks and a resource called "Frank" who has 5 of the 9 tasks assigned to him. I am trying to run something like the following...

tell application "OmniPlan"
set resourceName to "Frank"
tell front document
set numTasksAssigned to (count of tasks with resource whose name is resourceName)
if ((count of numTasksAssigned) < 1) then
display alert "There are no tasks assigned to resource " & resourceName
end if
end tell
end tell

But I get a 'Can't get 9 whose name = "Frank"' error. Ultimately, it should just return the number 5. I am sure my syntax is wrong. Any help would be greatly appreciated.