Help with applescript - alternate schedules

I could use some help with some applescript…I think.

I need to create optimistic and pessimistic schedules.

I have one script that copies task durations to custom data & then calculates optimistic & pessimistic values, storing those in custom data keys also. This works great on both small and large projects.

set optFactor to 0.95
set pessFactor to 1.1

tell application "OmniPlan"
	repeat with t in tasks of front document
		if task type of t is not group task then
			set myDuration to duration of t as number
			set optDuration to myDuration * optFactor
			set pessDuration to myDuration * pessFactor
			set value of custom data entry "backup_duration" of t to myDuration
			set value of custom data entry "optimistic" of t to optDuration
			set value of custom data entry "pessimistic" of t to pessDuration
		end if
	end repeat
end tell

now I want to run an optimistic schedule, this is what I’ve got

tell application "OmniPlan"
	repeat with t in tasks of front document
		if task type of t is not group task then
			set newDuration to value of custom data entry "optimistic" of t
			set duration of t to newDuration
		end if
	end repeat
end tell

on projects with 20 tasks, it works, but it’s slow
with 60 tasks, you can stop for coffee

On most of my full schedules, we have 400-500 tasks. I tried it on one and gave up after 5 minutes.

question - can I “pause” the scheduling engine during a script?

  • Anyone have pointers on ways to run different [user defined] simulations?

I used to do this all the time with MS proj
I trialed Merlin for a while and this was very fast.

The problem is walking through the task list. It’s just too slow.

These are construction projects, we do not use effort. The “Monte Carlo” type simulations do not give the results we are after.