The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniPlan > OmniPlan Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Simple Applescript, Create Task, Assign resource, Assign dependency Thread Tools Search this Thread Display Modes
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'
 
...so yeah...it was a newbie question. Figured it out eventually. I guess I just needed to declare the resource better. For those that care....

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}

--Declare your resource (person)
set personJamie to resources whose name is "Jamie"
set personSam to resource whose name is "Sam"

-- Assign the task to the resource
assign camTask to personJamie
assign bagTask to personSam

-- Set up your dependency
depend bagTask upon camTask

end tell
end tell
end tell
 
Actually I care, this looks like exactly what I'm trying to do. Thanks for the starting point!

-jim lee
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign resource shortcut? clayc OmniPlan General 0 2012-04-03 07:24 PM
Automatically assign a resource to new tasks? psidnell OmniPlan General 2 2012-03-28 11:09 PM
Create or assign project within iCal dmwatlse iCal Sync 0 2007-12-04 03:26 PM
Assign a period of time to work on a task each day Ben Greenfield OmniPlan General 6 2007-02-10 07:04 AM
Total Cost blank if assign task to resource group. gregc OmniPlan General 2 2007-02-06 12:15 PM


All times are GMT -8. The time now is 11:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.