ResourceCalendars & Events

OmniPlan is all about tracking how resources are used to accomplish tasks over time. And the most common mechanism for representing an extended period of time is through the use of a resource calendar.

In terms of the scripting architecture of OmniPlan, resource calendars are components of schedules, and every object that has a schedule (projects and resources) also has a default resource calendar object as well. With resources, the project schedule is used if there are no custom events or time allocations for the resource.

With Omni Automation in OmniPlan, scripts can not create external resource calendars or the events they display. However, scripts can access information about an object’s resource calendar and its events and use that information in performing automation tasks.

To access an object’s resource calendar, include a reference to the object’s inherit schedule.

NOTE: The Calendar class shared by the other Omni applications is also supported in OmniPlan (v3.13.3 macOS).

rsc = actual.resource("Bob Jones") if(rsc){ calNames = rsc.schedule.calendars.map((cal)=>{return cal.name}) }

ResourceCalendar Instance Properties

Here are the properties of an instance of the ResourceCalendar class:

CalendarEvent Instance Properties

Here are the properties of an instance of the CalendarEvent class:

Events for Specified Resource

As with calendars, calendar events cannot be created with scripts, but data about them can be gathered. The following example script demonstrates how to log information about all of the events for a specified resource.

rsc = actual.resource("Bob Jones") if(rsc){ console.log("Events for " + rsc.name) cals = rsc.schedule.calendars cals.forEach((cal)=>{ calEvents = cal.events calEvents.forEach((event)=>{ eventTitle = cal.name + ": " + event.title eventStart = event.start.toString() eventEnd = event.end.toString() console.log(eventTitle + "\n\t" + eventStart + "\n\t" + eventEnd) }) }) }

In the example shown in the illustration below, the staff (resource) calendar contains two events: the early event (blue shape scheduled @ 7AM) is created in OmniPlan, and the late event (blue shape scheduled @ 6PM) is subscribed from the Project calendar in Calendar application.

subscribed-calendar
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER