View Single Post
Ok, so i got this working. I had to create the project, build tasks and organize them into subtasks, then set the project start date, and finally run through all tasks again and set their starting/ending time.

Roughly, this is how i do it with python/py-appscript

(http://appscript.sourceforge.net/py-...ual/index.html)

Code:
# assume todos=[{"name":"task name","basecamp_id":"123","start_date":datetime,"end_date":datetime}]
from appscript import *
doc=app("OmniPlan").make(new=k.document)
all_tasks=[]
# create your resources
r=doc.make(new=k.resource,with_properties={k.name:t["assigned"]})
for t in todos:
   # here you might add a resource r
   task=doc.make(new=k.task,with_properties={k.name:t["name"]})
   task.assign(to=r)
   task.custom_data.set({"basecamp_id":t["basecamp_id"]})
   # i move to a parent task here:
   # doc.move(task,to=project_task.child_tasks.end)
   all_tasks.append((task,t)) # keep a record of this task and the todo for later

# then set the project start date
doc.project.starting_date.set(earliest_date)

# then iterate through all tasks AGAIN and set the start/end
for t in all_tasks:
   t[0].starting_date.set(t[1]["starting_date"])
   t[0].ending_date.set(t[1]["ending_date"])
Now to have my script rip back through and update my basecamp Due Dates :)