View Single Post
Hi,

I got some date problems too, using applescript:

here is my code:



property ATime : date
property BTime : date
property CDuration : 4
property ADur : 4
property BDur : 4

tell application "OmniPlan"
activate
set CTime to (current date)
set myDoc to front document
tell front document
-- set Myself to make new resource with properties {kind:person, efficiency:2, name:"Tom", cost per hour:200.0}
--set MyTask to make new task with properties {name:"Cure Cancer", starting date:CTime, duration:CDuration}
--assign MyTask to Myself
set ADur to duration of task "Cure Mat"
set duration of task "Cure Mat" to 12
set BDur to duration of task "Cure Mat"
set ATime to starting date of task "Cure Mat"
set BTime to current date
set starting date of task "Cure Mat" to BTime
set BTime to starting date of task "Cure Mat"
display dialog ADur & " " & BDur & return & ATime & return & BTime as string
end tell
end tell


It has been produced trough several manipulations.

His goal is to create a dock way to record the task I am actually doing.

The matter is:
I can affect easily the task durations, name... but not the "starting date" as soon as I do it, I encounter several problems:

Omniplan does update the actual start in the task information panel but nothing appear in the graph part.
and as soon as I wanna go to the ressource panel I got these error message:
"*** -[NSCFDate dayOfCommonEra]: selector not recognized [self = 0x5e197f0]"

Do you got a clue for me