Hello,
Newbie question that I have been wrestling with...I am sure somebody can clear this one up. I am trying to create a simple series of tasks (that have child tasks), that get assigned to a resource (person) that already exists in the resources area. I would (eventually) also like to add a dependency between child tasks as well. Right now...what I have looks like this (without the assign dependency part)...
set CTime to (current date)
tell application "OmniPlan"
tell first document
set newTask to make new task with properties {name:"sillyTask"}
tell newTask
set camTask to make new task with properties {name:"Camera", starting date:CTime, duration:36000}
set bagTask to make new task with properties {name:"Bag", starting date:CTime, duration:36000}
assign camTask to resource whose name is "Jamie"
assign bagTask to resource whose name is "Sam"
end tell
end tell
end tell
It creates the 'sillyTask' with child tasks 'Camera' and 'Bag', but I get an error saying...
Can’t get resource whose name = "Jamie".
...even though the resource/s clearly exist. I am sure it is simple scripting problem, but I have tried all manner of syntax...but just can't seem to get the resource name. Heeeeellllppp??
dexterama
PS. I would then like to make a dependency so that 'Bag' happens at the end of 'Camera'
Newbie question that I have been wrestling with...I am sure somebody can clear this one up. I am trying to create a simple series of tasks (that have child tasks), that get assigned to a resource (person) that already exists in the resources area. I would (eventually) also like to add a dependency between child tasks as well. Right now...what I have looks like this (without the assign dependency part)...
set CTime to (current date)
tell application "OmniPlan"
tell first document
set newTask to make new task with properties {name:"sillyTask"}
tell newTask
set camTask to make new task with properties {name:"Camera", starting date:CTime, duration:36000}
set bagTask to make new task with properties {name:"Bag", starting date:CTime, duration:36000}
assign camTask to resource whose name is "Jamie"
assign bagTask to resource whose name is "Sam"
end tell
end tell
end tell
It creates the 'sillyTask' with child tasks 'Camera' and 'Bag', but I get an error saying...
Can’t get resource whose name = "Jamie".
...even though the resource/s clearly exist. I am sure it is simple scripting problem, but I have tried all manner of syntax...but just can't seem to get the resource name. Heeeeellllppp??
dexterama
PS. I would then like to make a dependency so that 'Bag' happens at the end of 'Camera'