Assignment

An assignment.

Methods:

addEventListener, cancelPackage, createPackage, extractLabel, getElements, insertLabel, remove, removeEventListener, toSource, toSpecifier, update

Objects:

AssignedStories, AssignmentExportOptions, AssignmentStatus, Boolean, EventListeners, Events, File, NothingEnum, Number, Object, String, UIColors,

Preferences:

AssignmentExportOptions

Property Listing

Property

Type

Access

Description

assignedStories

AssignedStories AssignedStory

readonly

A collection of assigned stories.

assignmentFileStatus

AssignmentStatus

AssignmentStatus.ASSIGNMENT_FILE_MISSING

AssignmentStatus.ASSIGNMENT_OUT_OF_DATE

AssignmentStatus.ASSIGNMENT_UP_TO_DATE

readonly

The status of the assignment file.

documentPath

File

readonly

The path to the document that the hyperlink destination points to.

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

exportOptions

AssignmentExportOptions

AssignmentExportOptions.ASSIGNED_SPREADS

AssignmentExportOptions.EMPTY_FRAMES

AssignmentExportOptions.EVERYTHING

read/write

The content to export in the assignment.

filePath

String

File

readonly

The file path (colon delimited on the Mac OS). Can also accept: File.

frameColor

Array of 3 Reals (0 - 255)

NothingEnum.NOTHING

UIColors

read/write

The color of the assignment's frames. Can return: Array of 3 Reals (0 - 255) or UIColors enumerator or NothingEnum enumerator.

id

Number

readonly

The unique ID of the Assignment.

includeLinksWhenPackage

Boolean

read/write

If true, includes linked files when packaging the assignment.

index

Number

readonly

The index of the Assignment within its containing object.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

label

String

read/write

A property that can be set to any string.

name

String

read/write

The name of the Assignment.

packageUpToDate

Boolean

readonly

If true, the assignment package is up to date.

packaged

Boolean

readonly

If true, the assignment is packaged.

parent

Document

readonly

The parent of the Assignment (a Document).

properties

Object

read/write

A property that allows setting of several properties at the same time.

userName

String

read/write

The user name to assign to tracked changes and notes.

Method Listing

EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Adds an event listener.

Parameter

Type

Description

eventType

String

The event type.

handler

File

JavaScriptFunction

The event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

undefined cancelPackage ()

Cancels the package for an assignment.

File createPackage (filePath:File, [submit:Boolean=Boolean], withProperties:Object)

Creates an assignment package.

Parameter

Type

Description

filePath

File

The full path name of the assignment package file.

submit

Boolean

If true, submits assigned stories before packaging the assignment. (Optional)

(default: true)

withProperties

Object

Initial values for properties of the new Assignment (Optional)

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

Assignment getElements ()

Resolves the object specifier, creating an array of object references.

undefined insertLabel (key:String, value:String)

Sets the label to the value associated with the specified key.

Parameter

Type

Description

key

String

The key.

value

String

The value.

undefined remove ()

Deletes the assignment and its file.

Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Removes the event listener.

Parameter

Type

Description

eventType

String

The registered event type.

handler

File

JavaScriptFunction

The registered event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

String toSource ()

Generates a string which, if executed, will return the Assignment.

String toSpecifier ()

Retrieves the object specifier.

undefined update (versionComments:String, [forceSave:Boolean=Boolean])

Updates the assignment file.

Parameter

Type

Description

versionComments

String

The comment for this version. (Optional)

forceSave

Boolean

If true, forcibly saves a version. (Optional)

(default: false)

Object of

AssignedStory.parent

Event.parent

EventListener.parent

MutationEvent.parent

Return

Assignments.add()

Assignment.getElements()

Assignments.anyItem()

Assignments.everyItem()

Assignments.nextItem()

Assignments.previousItem()

Assignments.itemByID()

Assignments.item()

Assignments.[]()

Assignments.itemByName()

Assignments.itemByRange()

Assignments.firstItem()

Assignments.lastItem()

Assignments.middleItem()