Skip to main content
Version: 7.9

system.user.getSchedules

This function is used in Python Scripting.

Description

Returns a sequence of all available schedule models, which can be used to return configuration information on the schedule, such as time for each day of the week.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.user.getSchedules()

Parameters

None

Returns

List - A list of ScheduleModel objects. ScheduleModel objects can be a Basic Schedule, Composite Schedule (composed of exactly two other schedules), or another type registered by a module.

Scope

Gateway, Designer, Client

Code Examples

Example #1
# This example will print a list of all available ScheduleModels:

# This function handles recursive printing of the different schedule models. Modules can register more types than listed here.
def printScheduleInfo(aSchedule):
if aSchedule.getType() == "basic schedule":
print "Basic schedule type: ",aSchedule.getName(), aSchedule.getDescription(), aSchedule.isAllDays(), aSchedule.getAllDayTime()
elif aSchedule.getType() == "composite schedule":
compositePieces = aSchedule.getModels()
print "Composite schedule type:",aSchedule.getName(), aSchedule.getDescription(), " which is made up of..."
for piece in compositePieces:
printScheduleInfo(piece)
else:
print "Other schedule type: ", aSchedule.getName(), aSchedule.getDescription(), aSchedule.getType(), aSchedule.isObserveHolidays()


# The main function
schedules = system.user.getSchedules()
for schedule in schedules:
printScheduleInfo(schedule)
Example #1 Output
Basic schedule type:  A None True 0:00-24:00
Basic schedule type: Always Built-in schedule that is always available: 24x7x365 True 0:00-24:00
Basic schedule type: B None True 0:00-24:00
Basic schedule type: C None True 0:00-24:00
Basic schedule type: Example An example of a M-F 8am-5pm schedule with a lunch break False 0:00-24:00
Composite schedule type: MyComposite a composite schedule which is made up of...
Basic schedule type: A None True 0:00-24:00
Basic schedule type: B None True 0:00-24:00
Basic schedule type: MySchedule A description False 0:00-24:00