A Schedule is a plan for carrying out a process or procedure, providing lists of intended events and times. The scenario (project) object has a default schedule, as do individual resources.
Resource schedules inherit the effects of calendars in the project or of calendars in any groups the resources are inside, but they don't inherit the calendars themselves. For example, if you add a vacation day in the project calendar, every resource will not work that day, but that doesn't change each resource's individual calendars.
Think of a calendar as a list of changes from what the resource would normally be doing, and of a schedule as being the resulting work times, taking into account all of the calendars for the resource and up the hierarchy of groups and the project.
The properties of an instance of the Schedule class:
calendars (Array of Calendar r/o) • All calendars in this schedule. OmniPlan manages two built-in calendars for each schedule: an off-time calendar and an overtime calendar. Additional calendars may be added by synchronizing with Calendar.app or ical URLs, etc.
Here are the functions that can be called on an instance of the Schedule class.
endDate(start:Date, duration:Duration) → (Date) • Compute the end date for a given start date and duration in this schedule.
startDate(end:Date, duration:Duration) → (Date) • Compute the start date for a given end date and duration in this schedule.
durationBetween(start:Date, end:Date) → (Duration) • Compute the work-second duration between a given start date and end date in this schedule.
The following script example uses the startDate and endDate properties of the Scenario class (not to be confused with the startDate() and endDate() functions of the Schedule class), along with the durationBetween(…) instance function of the Schedule class, in order to display a dialog showing the current length of the project measured in days.
|Show Project Length in Days|
|01||sDate = actual.startDate|
|02||eDate = actual.endDate|
|03||projectDuration = actual.schedule.durationBetween(sDate, eDate)|
|04||projectDays = projectDuration.workSeconds/86400|
|05||projectDays = projectDays.toFixed(2)|
|06||alertTitle = "Project Length in Days"|
|07||alertMessage = "The current project length is " + String(projectDays) + " days."|
|08||new Alert(alertTitle, alertMessage).show()|
This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.