Alert

An alert interface for displaying information to the user, blocking further interaction until the alert is dismissed.

Constructors

new Alert(title:String, message:String)Alert

Create a new alert panel with the given title and text contents.

Instance Functions

function show(callback:Function or null)Promise

Displays the alert, unless an alert is already being displayed, in which case an error is thrown. If no options have yet been added, a default "OK" option is added. Once the user selects an option, the alert is dismissed. If a callback function was supplied, it is invoked with the zero-based index of the selected option as its argument. A Promise is returned as well, which may also be used to collect the result of the Alert.

function addOption(string:String)

Adds an option button to the alert.

Application

No documentation available.

Instance Functions

function openDocument(from:Document or null, url:URL, completed:Function)

Attempts to open the specified document and return a reference to it asynchronously. If the document is already open, the reference is passed along. Note that due to platform sandboxing restrictions, opening the document may fail if the application doesn't have currently permission to access the given URL. The document, if any, that is associated with the calling script can be passed along to help grant permission to open the new document. The passed in function will be passed two argument. The first will be either either the Document or an Error. On success, the second argument is a Boolean specifying whether the document was already open.

Instance Properties

var commandKeyDownBoolean read-only

No documentation available.

var controlKeyDownBoolean read-only

No documentation available.

var nameString read-only

Application name.

var optionKeyDownBoolean read-only

No documentation available.

var platformNameString read-only

No documentation available.

var shiftKeyDownBoolean read-only

No documentation available.

var versionString read-only

Application version number.

ApplyResult

No documentation available.

Class Properties

var SkipChildrenApplyResult read-only

The descendants of the current item are skipped.

var SkipPeersApplyResult read-only

The unvisited peers of the current item are skipped.

var StopApplyResult read-only

The call to apply terminates with no further items being visited.

var allArray of ApplyResult read-only

An array of all items of this enumeration.

Array

A JavaScript Array.

Inbox: Array

An Array of tasks that are in the inbox.

Instance Functions

function apply(function:Function)ApplyResult or null

Calls the given function for each Task in the Inbox and recursively into any child tasks.

Instance Properties

var beginningTask.ChildInsertionLocation read-only

A location that can be used when adding, duplicating, or moving tasks.

var endingTask.ChildInsertionLocation read-only

A location that can be used when adding, duplicating, or moving tasks.

Library: Array

An Array of folders and projects at the top level of the database.

Instance Functions

function apply(function:Function)ApplyResult or null

Calls the given function for each Folder and Project in the Library and recursively into any child folders. Note that the tasks in projects are not descended into.

Instance Properties

var beginningFolder.ChildInsertionLocation read-only

Returns a location refering to the beginning of the top-level projects and folders in the database.

var endingFolder.ChildInsertionLocation read-only

Returns a location refering to the ending of the top-level projects and folders in the database.

Tags: Array

An Array of tags at the top level of the database.

Instance Functions

function apply(function:Function)ApplyResult or null

Calls the given function for each Tag in the Library and recursively into any child tags.

Instance Properties

var beginningTag.ChildInsertionLocation read-only

Returns a location refering to the beginning of the top-level tags in the database.

var endingTag.ChildInsertionLocation read-only

Returns a location refering to the ending of the top-level tags in the database.

Calendar

No documentation available.

Class Properties

var buddhistCalendar read-only

No documentation available.

var chineseCalendar read-only

No documentation available.

var copticCalendar read-only

No documentation available.

var currentCalendar read-only

The user's preferred calendar

var ethiopicAmeteAlemCalendar read-only

No documentation available.

var ethiopicAmeteMihretCalendar read-only

No documentation available.

var gregorianCalendar read-only

The Gregorian calendar.

var hebrewCalendar read-only

No documentation available.

var indianCalendar read-only

No documentation available.

var islamicCalendar read-only

No documentation available.

var islamicCivilCalendar read-only

No documentation available.

var islamicTabularCalendar read-only

No documentation available.

var islamicUmmAlQuraCalendar read-only

No documentation available.

var iso8601Calendar read-only

No documentation available.

var japaneseCalendar read-only

No documentation available.

var persianCalendar read-only

No documentation available.

var republicOfChinaCalendar read-only

No documentation available.

Instance Functions

function dateByAddingDateComponents(date:Date, components:DateComponents)Date or null

Returns a new Date by adding the given DateComponents, or null if no date could be calculated.

function dateFromDateComponents(components:DateComponents)Date or null

Returns a new Date from the given DateComponents, or null if no date could be calculated.

function dateComponentsFromDate(date:Date)DateComponents

Returns a new DateComponents for the given Date.

function dateComponentsBetweenDates(start:Date, end:Date)DateComponents

Returns the difference from the start Date to the end Date as a DateComponents.

function startOfDay(date:Date)Date

Returns a Date for the first moment of the day containing the given Date according to this Calendar.

Instance Properties

var identifierString read-only

The ISO identifier for the calendar.

var localeLocale or null read-only

The locale of the calendar.

var timeZoneTimeZone read-only

The time zone of the calendar.

Color

No documentation available.

Class Functions

function RGB(r:Number, g:Number, b:Number, a:Number or null)Color

Makes a new color in the RGB colorspace, with the given components. If the alpha component is not given, 1.0 is used.

function HSB(h:Number, s:Number, b:Number, a:Number or null)Color

Makes a new color in the HSB colorspace, with the given components. If the alpha component is not given, 1.0 is used.

function White(w:Number, a:Number or null)Color

Makes a new color in the White colorspace, with the given components. If the alpha component is not given, 1.0 is used.

Class Properties

var blackColor read-only

A color in the White colorspace with white component of 0.0.

var blueColor read-only

A color in the RGB colorspace with components (0, 0, 1, 1).

var brownColor read-only

A color in the RGB colorspace with components (0.6, 0.4, 0.2, 1).

var clearColor read-only

A color in the White colorspace with white component of 0.0 and alpha of 0.0 ("transparent black").

var cyanColor read-only

A color in the RGB colorspace with components (0, 1, 1, 1).

var darkGrayColor read-only

A color in the White colorspace with white component of 0.333.

var grayColor read-only

A color in the White colorspace with white component of 0.5.

var greenColor read-only

A color in the RGB colorspace with components (0, 1, 0, 1).

var lightGrayColor read-only

A color in the White colorspace with white component of 0.667.

var magentaColor read-only

A color in the RGB colorspace with components (1, 0, 1, 1).

var orangeColor read-only

A color in the RGB colorspace with components (1, 0.5, 0, 1).

var purpleColor read-only

A color in the RGB colorspace with components (1, 0, 1, 1).

var redColor read-only

A color in the RGB colorspace with components (1, 0, 0, 1).

var whiteColor read-only

A color in the White colorspace with white component of 1.0.

var yellowColor read-only

A color in the RGB colorspace with components (1, 1, 0, 1).

Instance Functions

function blend(otherColor:Color, fraction:Number)Color or null

Returns a new color that is a linear combination of the receiver and fraction of the other color (so, a fraction of 1.0 would just return the otherColor. If the colors cannot be blended (for example, if they cannot be converted to the same colorspace), then null is returned.

Instance Properties

var alphaNumber read-only

Returns the alpha component of the color.

var blueNumber read-only

Returns the blue component of the color, after converting to a RGB colorspace.

var brightnessNumber read-only

Returns the brightness component of the color, after converting to a HSB colorspace.

var colorSpaceColorSpace read-only

Returns the colorspace of the instance.

var greenNumber read-only

Returns the green component of the color, after converting to a RGB colorspace.

var hueNumber read-only

Returns the hue component of the color, after converting to a HSB colorspace.

var redNumber read-only

Returns the red component of the color, after converting to a RGB colorspace.

var saturationNumber read-only

Returns the saturation component of the color, after converting to a HSB colorspace.

var whiteNumber read-only

Returns the white component of the color, after converting to a White colorspace.

ColorSpace

No documentation available.

Class Properties

var CMYKColorSpace read-only

A colorspace with cyan, magenta, yellow, black, and alpha components.

var HSBColorSpace read-only

A colorspace with hue, saturation, and value (or brightness) components.

var NamedColorSpace read-only

A space for named colors, like system defined colors, or specific color palette spaces.

var PatternColorSpace read-only

A colorspace that wraps a pattern image.

var RGBColorSpace read-only

The sRGB colorspace with red, green, blue, and alpha components.

var WhiteColorSpace read-only

A colorspace with white and alpha components.

var allArray of ColorSpace read-only

An array of all items of this enumeration.

Console

The Console allows scripts to log debugging, warning, or error information where it can be viewed in the system console or in the console output area. A single instance of Console is available to scripts as the console global variable.

Instance Functions

function log(message:Object, additional:Array of Object or null)

Appends a line to the application console formed by concatenating the given message (after converting it to a String), any additional arguments separated by spaces, and finally a newline.

function error(message:Object, additional:Array of Object or null)

No documentation available.

function info(message:Object, additional:Array of Object or null)

No documentation available.

function warn(message:Object, additional:Array of Object or null)

Just calls Console.log, currently.

function clear()

Clears the console in the user-visible window.

Data

A generic bag of bytes. Mainly useful to be interpreted / converted to some other type.

Class Functions

function fromString(string:String)Data

Convert from a String to the UTF8 encoding of that string as Data

function fromBase64(string:String)Data

No documentation available.

Instance Functions

function toString()String

Convert to a String, assuming that this Data is encoded as UTF8.

function toBase64()String

Convert to a Base-64 encoded string.

Instance Properties

var lengthNumber read-only

Number of bytes in this data.

var toObjectObject or null read-only

No documentation available.

Database

No documentation available.

Instance Functions

function tagNamed(name:String)Tag or null

Returns the first top-level Tag with the given name, or null.

function folderNamed(name:String)Folder or null

Returns the first top-level Folder with the given name, or null.

function projectNamed(name:String)Project or null

Returns the first top-level Project with the given name, or null.

function taskNamed(name:String)Task or null

Returns the first top-level Task in the inbox with the given name, or null.

function save()

No documentation available.

function moveTasks(tasks:Array of Task, position:Project, Task, or Task.ChildInsertionLocation)

No documentation available.

function duplicateTasks(tasks:Array of Task, position:Project, Task, or Task.ChildInsertionLocation)Array of Task

Makes copies of the tasks and returns the new copies. The order of the inputs is not considered and the copies are returned in library order of the originals.

function moveSections(sections:Array of Project or Folder, position:Folder or Folder.ChildInsertionLocation)

No documentation available.

function duplicateSections(sections:Array of Project or Folder, position:Folder or Folder.ChildInsertionLocation)Array of Project or Folder

Makes copies of the sections and returns the new copies. The order of the inputs is not considered and the copies are returned in library order of the originals.

function moveTags(tags:Array of Tag, position:Tag or Tag.ChildInsertionLocation)

No documentation available.

function duplicateTags(tags:Array of Tag, position:Tag or Tag.ChildInsertionLocation)Array of Tag

Makes copies of the tags and returns the new copies. The order of the inputs is not considered and the copies are returned in library order of the originals.

function cleanUp()

Processes inbox items that have the required information to move into their proposed containers, performs any delayed filtering, and deletes empty items.

function undo()

Undoes the last undoable action, or throws an error if there are no undoable actions.

function redo()

Redoes the next redoable action, or throws an error if there are no redoable actions.

function deleteObject(object:DatabaseObject)

Removes the object from the Database.

Instance Properties

var canRedoBoolean read-only

Returns true if there are redoable actions.

var canUndoBoolean read-only

Returns true if there are undoable actions.

var documentDatabaseDocument or null read-only

No documentation available.

var flattenedFoldersArray of Folder read-only

Returns a flat array of all folders in the database, sorted in their order in the database.

var flattenedProjectsArray of Project read-only

Returns a flat array of all projects in the database, sorted in their order in the database.

var flattenedTagsArray of Tag read-only

Returns a flat array of all tags in the database, sorted in their order in the database.

var flattenedTasksArray of Task read-only

Returns a flat array of all tasks in the database, including inbox items, root tasks for projects, task groups and individual tasks. Tasks are sorted in their order in the database, with the inbox preceeding the library.

var foldersArray of Folder read-only

Returns the top-level folders in the database.

var inboxInbox read-only

Returns a copy of the Tasks currently in the inbox.

var libraryLibrary read-only

Returns the top-level folders and projects in the database.

var projectsArray of Project read-only

Returns the top-level folders in the database.

var settingsSettings read-only

No documentation available.

var tagsTags read-only

Returns the top-level tags in the database.

DatabaseObject

No documentation available.

Instance Properties

var idObjectIdentifier read-only

Returns the identifier for this object.

DatedObject: DatabaseObject

No documentation available.

Instance Properties

var addedDate or null

Returns the date the object was first saved. If the object is newly inserted, this will be null. For newly inserted objects, the added property may be set (but once an object is saved for the first time, the property is read-only).

var modifiedDate or null

Returns the date the object was most recently modified. If the object is newly inserted, this will be null. For newly inserted objects, the modified property may be set (but once an object is saved for the first time, the property is read-only).

ActiveObject: DatedObject

No documentation available.

Instance Properties

var activeBoolean

If true, then this object is considered active, otherwise the object is considered dropped.

var effectiveActiveBoolean read-only

Returns true if this object and all its containers are active.

Folder: ActiveObject

No documentation available.

Constructors

new Folder(name:String, position:Folder or Folder.ChildInsertionLocation or null)Folder

No documentation available.

Instance Functions

function folderNamed(name:String)Folder or null

Returns the first child Folder of this folder with the given name, or null.

function projectNamed(name:String)Project or null

Returns the first child Project of this folder with the given name, or null.

function apply(function:Function)ApplyResult or null

Calls the given function for this Folder and recursively into any child folders and projects. The tasks within any projects are not descended into.

Instance Properties

var afterFolder.ChildInsertionLocation read-only

Returns a location refering to position just after this folder.

var beforeFolder.ChildInsertionLocation read-only

Returns a location refering to position just before this folder.

var beginningFolder.ChildInsertionLocation read-only

Returns a location refering to the beginning of the contained projects and folders in this folder.

var childrenArray of Project or Folder read-only

Returns a sorted list of the folders and projects contained within this folder.

var endingFolder.ChildInsertionLocation read-only

Returns a location refering to the ending of the contained projects and folders in this folder.

var foldersArray of Folder read-only

Returns the child folders of this folder.

var nameString

The name of the folder.

var projectsArray of Project read-only

Returns the projects contained directly as children of this folder.

Tag: ActiveObject

No documentation available.

Constructors

new Tag(name:String, position:Tag or Tag.ChildInsertionLocation or null)Tag

No documentation available.

Instance Functions

function tagNamed(name:String)Tag or null

Returns the first child Tag of this tag with the given name, or null.

function apply(function:Function)ApplyResult or null

Calls the given function for this Tag and recursively into any child tags.

Instance Properties

var afterTag.ChildInsertionLocation read-only

Returns a location refering to position just after this tag.

var availableTasksArray of Task read-only

Returns a sorted list of the tasks associated with this tag that are currently available. Recent changes may not be reflected until a cleanUp is performed on the database.

var beforeTag.ChildInsertionLocation read-only

Returns a location refering to position just before this tag.

var beginningTag.ChildInsertionLocation read-only

Returns a location refering to the beginning of the contained tags in this tag.

var childrenArray of Tag read-only

Returns a sorted list of the tags contained within this tag.

var endingTag.ChildInsertionLocation read-only

Returns a location refering to the ending of the contained tags in this tag.

var nameString

No documentation available.

var projectsArray of Project read-only

A convenience property that returns only Projects for the root tasks associated with this Tag.

var remainingTasksArray of Task read-only

Returns a sorted list of the tasks associated with this tag that remaing to be completed. Recent changes may not be reflected until a cleanUp is performed on the database.

var tasksArray of Task read-only

Returns a sorted list of the tasks associated with this tag.

Task: ActiveObject

No documentation available.

Constructors

new Task(name:String, position:Project, Task, or Task.ChildInsertionLocation or null)Task

Returns a new Task at the given location. If a project or task is given as a location, the new task is placed at the end of the children of that parent. If no location is specified, then the task is created at the end of the inbox.

Instance Functions

function taskNamed(name:String)Task or null

Returns the first child Task in this task with the given name, or null.

function addTag(tag:Tag)

Adds a Tag to this task, appending it to the end of the list of associated tags. If the tag is already present, no change is made. The Database function moveTags can be used to control the ordering of tags within the task.

function addTags(tags:Array of Tag)

Adds multiple Tags to this task, appending them to the end of the list of associated tags. For any tags already associated with the Task, no change is made. The Database function moveTags can be used to control the ordering of tags within the task.

function removeTag(tag:Tag)

Removes a Tag from this task. If the tag is not associated with this task, no change is made.

function removeTags(tags:Array of Tag)

Removes multiple Tags from this task. If a tag is not associated with this task, no change is made.

function markComplete(date:Date or null)Task

If the task is not completed, marks it as complete with the given completion date (or the current date if no date is specified). For repeating tasks, this makes a clone of the task and marks that clone as completed. In either case, the task that has been marked completed is returned.

function markIncomplete()

If the task is completed, marks it as incomplete.

function apply(function:Function)ApplyResult or null

Calls the given function for this Task and recursively into any child task.

Instance Properties

var afterTask.ChildInsertionLocation read-only

No documentation available.

var assignedContainerProject, Task, or Inbox or null

For tasks in the inbox, the tentatively assigned project or parent task, which will be applied on cleanup.

var beforeTask.ChildInsertionLocation read-only

No documentation available.

var beginningTask.ChildInsertionLocation read-only

No documentation available.

var childrenArray of Task read-only

Returns all the child tasks of this task, sorted by library order.

var completedBoolean read-only

True if the task has been marked completed. Note that a task may be effectively considered completed if a containing task is marked completed.

var completedByChildrenBoolean

If set, the Task will be automatically marked completed when its last child Task is marked completed.

var completionDateDate or null read-only

If set, the Task is completed.

var containingProjectProject or null read-only

The Project that this Task is contained in, either as the root of the project or indirectly from a parent task. If this task is in the inbox, then this will be null.

var deferDateDate or null

If set, the Task is not actionable until this date.

var dueDateDate or null

If set, the Task should be completed by this date.

var effectiveDeferDateDate or null read-only

Returns the computed effective defer date for the Task, based on its local deferDate and those of its containers.

var effectiveDueDateDate or null read-only

Returns the computed effective due date for the Task, based on its local dateDue and those of its containers.

var endingTask.ChildInsertionLocation read-only

No documentation available.

var estimatedMinutesNumber or null

The estimated number of minutes this task will take to finish, or null if no estimate has been made.

var flaggedBoolean

The flagged status of the task.

var hasChildrenBoolean read-only

Returns true if this task has children, more efficiently than checking if children is empty.

var inInboxBoolean read-only

True if the task is a direct child of the inbox, but not if the task is contained by another task that is in the inbox.

var nameString

The title of the task.

var noteString

The tasks's note.

var projectProject or null read-only

The Project that this Task is the root task of, or null if this task is in the inbox or contained by another task.

var sequentialBoolean

If true, then children of this task form a dependency chain. For example, the first task blocks the second one until the first is completed.

var tagsArray of Tag read-only

Returns the Tags associated with this Task.

var taskStatusTask.Status read-only

Returns the current status of the task.

Perspective.Custom: DatedObject

No documentation available.

Instance Properties

var identifierString read-only

No documentation available.

var nameString read-only

No documentation available.

Project: DatabaseObject

No documentation available.

Constructors

new Project(name:String, position:Folder or Folder.ChildInsertionLocation or null)Project

No documentation available.

Instance Functions

function taskNamed(name:String)Task or null

Returns the first top-level Task in this project the given name, or null.

Instance Properties

var afterFolder.ChildInsertionLocation read-only

Returns a location refering to the position just after this project within its containing Folder or Database.

var beforeFolder.ChildInsertionLocation read-only

Returns a location refering to the position just before this project within its containing Folder or Database.

var beginningTask.ChildInsertionLocation read-only

Returns a location referring to the position after the last Task directly contained in the root task of this project.

var containsSingletonActionsBoolean

If set to true, the project contains single tasks, and has no next task.

var defaultSingletonActionHolderBoolean

If set to true, this is the Project that inbox tasks that have enough information specified (as selected by the user's preferences) will be filed into upon a clean-up.

var endingTask.ChildInsertionLocation read-only

Returns a location referring to the position before the first Task directly contained in the root task of this project.

var lastReviewDateDate or null

No documentation available.

var nameString

The name of the Projects root task.

var nextReviewDateDate or null

No documentation available.

var nextTaskTask or null read-only

Returns the very next task that can be completed in the project, or null if there is none or the project contains singleton actions.

var statusProject.Status

The current status of the project as a whole. This does not reflect the status of individual tasks within the project root task -- a project may be marked with the Done status and its individual tasks will be left with the completion state they had, in case the status is changed again to Active.

var taskTask read-only

Returns the root task of the project, which holds the bulk of the project information, as well as being the container for tasks within the project. If you wish to copy the project or move it to a location that requires tasks, you would use this task as the object to be copied or moved.

DateComponents

No documentation available.

Constructors

new DateComponents()DateComponents

No documentation available.

Instance Properties

var dateDate or null read-only

No documentation available.

var dayNumber or null

No documentation available.

var eraNumber or null

No documentation available.

var hourNumber or null

No documentation available.

var minuteNumber or null

No documentation available.

var monthNumber or null

No documentation available.

var nanosecondNumber or null

No documentation available.

var secondNumber or null

No documentation available.

var timeZoneTimeZone or null

No documentation available.

var yearNumber or null

No documentation available.

Decimal

The Decimal class provides support for operating on base-10 numbers, which may not be exactly representable by types like the built-in JavaScript Number class. Note that Decimal does not use the built-in arithmetic operations; for example, to add two Decimal instances, you must use the add() function.

Class Functions

function fromString(string:String)Decimal

Parses the given string into a Decimal. If the string cannot be parsed, notANumber is returned.

Class Properties

var maximumDecimal read-only

Returns the maximum representable Decimal value.

var minimumDecimal read-only

Returns the minimum representable Decimal value.

var notANumberDecimal read-only

Returns a Decimal that represents a non-number value. Any arithmetic operations involving non-number values will return notANumber.

var oneDecimal read-only

Returns a Decimal representing one.

var zeroDecimal read-only

Returns a Decimal representing zero.

Instance Functions

function toString()String

Converts the Decimal to a String representation.

function add(number:Decimal)Decimal

Generates a new Decimal by adding the argument and the receiver.

function subtract(number:Decimal)Decimal

Generates a new Decimal by subtracting the argument from the receiver.

function multiply(number:Decimal)Decimal

Generates a new Decimal by multiplying the argument and the receiver.

function divide(number:Decimal)Decimal

Generates a new Decimal by dividing the receiver by the argument.

function compare(number:Decimal)Number

Compares the receiver and argument. If the receiver is less than the argument, -1 is returned. If the receiver is greater than the argument, 1 is returned. Otherwise, 0 is returned. notANumber is considered less than any valid number, and equal to itself.

function equals(number:Decimal)Boolean

Returns true if the receiver and argument represent the same number (or both are notANumber), and false otherwise.

Document

No documentation available.

Class Functions

function makeNew(resultFunction:Function)

Create a new document, which can be populated with data and then presented. On iOS, if the document is not presented by the time the resultFunction returns, it will be closed. On macOS, the document will be left around and accessible to the running script. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.

function makeNewAndShow(resultFunction:Function)

Create a new document and presents it. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.

Instance Functions

function close(didCancel:Function or null)

Close this document. If for some reason the document cannot be closed, the didCancel function may be called at some point in the future, with the original document as the single argument. For example, on the Mac the user may review unsaved changes and may cancel the close operation. If the document is closed, the didCancel function will not be called at all.

function save()

Save this document.

function fileWrapper(type:String or null)FileWrapper

Deprecated: Please use makeFileWrapper() instead. Returns a new FileWrapper representing the contents of the document formatted as the specified type, or its current fileType if a null is passed for the type.

function makeFileWrapper(baseName:String, type:String or null)Promise

Generates a FileWrapper representing the contents of the document formatted as the specified type, or its current fileType if a null is passed for the type. Returns a Promise that will yield the file wrapper or an error. The returned file wrapper will have a name based off the given baseName and the default path extension for the requested file type.

function undo()

Undo the last done action.

function redo()

Redo the last undone action.

function show(resultFunction:Function or null)

Presents the document, ordering the window forward on macOS, and possibly closing the existing document and opening the new on on iOS.

Instance Properties

var canRedoBoolean read-only

Whether there are currently any actions that can be redone.

var canUndoBoolean read-only

Whether there are currently any actions that can be undone.

var fileTypeString or null read-only

The file type identifier the document uses when saving, if set.

var nameString or null read-only

Document name.

var writableTypesArray of String read-only

A list of all of the file types that this document can be written as.

DatabaseDocument: Document

No documentation available.

Instance Properties

var windowsArray of DocumentWindow read-only

No documentation available.

Email

A set of parameters for generating an email.

Constructors

new Email()Email

No documentation available.

Instance Functions

function generate()

Presents the generated email to the user for them to send (or discard). On iOS, any included attachment FileWrappers that are directories will be converted to Zip files.

Instance Properties

var blindCarbonCopyString or null

No documentation available.

var bodyString or null

No documentation available.

var carbonCopyString or null

No documentation available.

var fileWrappersArray of FileWrapper

No documentation available.

var receiverString or null

No documentation available.

var subjectString or null

No documentation available.

Error

FilePicker

A FilePicker allows the user to select URLs for files via the system-supplied file picking interface.

Constructors

new FilePicker()FilePicker

Returns a new FilePicker with default settings.

Instance Functions

function show()Promise

Presents the system file selection interface to the user, allowing them to choose one or more files of the given types. The returned Promise will yield the chosen URLs on success. If the user cancels chosing, the Promise will be rejected. Note that even when picking a single file or folder, the result will be an array of URLs.

Instance Properties

var foldersBoolean

If true, then folders may be selected, but not files. In this case, types is ignored. Defaults to false.

var messageString

A message to display describing what files are being picked. This is currently only supported on macOS.

var multipleBoolean

If true, then multiple files may be selected. Defaults to false.

var typesArray of FileType or null

The file types that will be allowed. If null, all file types will be allowed. Defaults to null.

FileSaver

A FileSaver allows the user to save a FileWrapper to a URLs via the system-supplied file picking interface.

Constructors

new FileSaver()FileSaver

Returns a new FileSaver with default settings.

Instance Functions

function show(fileWrapper:FileWrapper)Promise

Presents the system file saving interface to the user, allowing them to choose a location and file name to save the file wrapper. The returned Promise will yield the chosen URL on success. If the user cancels chosing, the Promise will be rejected.

Instance Properties

var messageString

A message to display describing what file is being saved. This is currently only supported on macOS.

var nameLabelString

The label shown next to the user-editable file name field. This is currently only supported on macOS.

var promptString

The prompt shown on the the save button. This is currently only supported on macOS.

var typesArray of FileType or null

The file types that will be allowed. If null, all file types will be allowed. Defaults to null.

FileType

No documentation available.

Class Properties

var binaryPropertyListFileType read-only

The binary property list file type.

var csvFileType read-only

The comma-separated text file type.

var gifFileType read-only

The GIF image file type.

var imageFileType read-only

A generic file type that all image types conform to.

var jpegFileType read-only

The JPEG image file type.

var jsonFileType read-only

The JSON file type.

var pdfFileType read-only

The PDF file type.

var plainTextFileType read-only

The plain text file type.

var pngFileType read-only

The PNG image file type.

var propertyListFileType read-only

The generic property list file type.

var readableTypesArray of FileType read-only

The list of FileTypes that can be read by documents in this this application.

var rtfFileType read-only

The RTF file type.

var rtfdFileType read-only

The RTFD file type.

var tiffFileType read-only

The TIFF image file type.

var writableTypesArray of FileType read-only

The list of FileTypes that can be written by documents in this application (though some documents may be exportable only in a subset of these types).

var xmlPropertyListFileType read-only

The XML property list file type.

Constructors

new FileType(identifier:String)FileType

Returns a new FileType with the given identifier.

Instance Functions

function conformsTo(fileType:FileType)Boolean

Returns true if the instance is the same as the given argument or a more specific type. For example, FileType.png.conformsTo(FileType.image) will be true, but FileType.png.conformsTo(FileType.plainText) will be false.

Instance Properties

var displayNameString read-only

Returns a human-readable description of the file type.

var identifierString read-only

Returns a unique identifier for a file type, suitable for archiving or encoding in scripts.

var pathExtensionsArray of String read-only

The list of filesystem path extensions used by this file type.

FileWrapper

No documentation available.

Class Functions

function withContents(name:String or null, contents:Data)FileWrapper

Returns a new FileWrapper that represents a flat file containing the given data.

function withChildren(name:String or null, children:Array of FileWrapper)FileWrapper

Returns a new FileWrapper that represents a directory with the given child file wrappers. Each child file wrapper must have a unique name specified.

Instance Functions

function filenameForChild(child:FileWrapper)String or null

Returns the unique file name that will be used for the given child FileWrapper, or null if this file wrapper is not a child of the receiver.

Instance Properties

var childrenArray of FileWrapper read-only

Returns an Array of child FileWrappers, if this represents a directory. Otherwise, an empty array is returned.

var contentsData or null read-only

Returns the regular file contents of the wrapper, if this represents a regular file. Otherwise, null is returned.

var destinationURL or null read-only

Returns the destination if this represents a symbolic link. Otherwise, null is returned.

var filenameString or null

Returns the actual file name that was last read for this file wrapper. Depending on the names of other sibling wrappers, this may not be what file name will be written.

var preferredFilenameString or null

Returns the preferred file name that should be used when writing the file wrapper if no other file in the same parent directory wrapper is in use.

var typeFileWrapper.Type read-only

Returns the type of this FileWrapper.

FileWrapper.Type

No documentation available.

Class Properties

var DirectoryFileWrapper.Type read-only

A FileWrapper that represents a directory with zero or more child wrappers.

var FileFileWrapper.Type read-only

A FileWrapper that represents a regular file with data contents.

var LinkFileWrapper.Type read-only

A FileWrapper that represents a symbolic link to another location.

var allArray of FileWrapper.Type read-only

An array of all items of this enumeration.

Folder.ChildInsertionLocation

No documentation available.

Form

Form provides a mechanism to collect input from the user. Each form contains one or more instances of subclasses of Field, which are given a key. As the form is filled out, values object is populated with the values from the user interface.

Constructors

new Form()Form

No documentation available.

Instance Functions

function addField(field:Form.Field, index:Number or null)

Adds the new Field to the Form, at the indicated position, or at the end if no position is specified. If the field has a default value, it will be added to the values result object immediately.

function removeField(field:Form.Field)

Removes the Field from the Form. Any entry in the values` for this field will be removed as well.

function show(title:String, confirmTitle:String)Promise

Present the Form to the user, and return a Promise to be fullfilled or rejected when the user commits or cancels the form.

Instance Properties

var fieldsArray of Form.Field read-only

The current Field instances in the form, which will be visible to the user entering input.

var validateFunction or null

A function to check whether the entered values are acceptable. The form to validate is passed as the argument and the function is expected to return a boolean result. If an Error is thrown, it's message will be displayed in the form as the reason for validation failure. Note that the validation function may add or remove fields and update entries in the values object (which will cause the interface to be updated). This is called any time the user edits values, or a field is added or removed.

var valuesObject read-only

An object with the collected values for each field, stored under the key for that field.

Form.Field

A single entry for a user input value in a Form. Each field can only be added to a single Form. This class cannot be constructed directly.

Instance Properties

var displayNameString or null read-only

Human readable string used as the label for this field.

var keyString read-only

Key to use when storing the value for this field in the containing form's values object.

Form.Field.Checkbox: Form.Field

No documentation available.

Constructors

new Form.Field.Checkbox(key:String, displayName:String or null, value:Boolean or null)Form.Field.Checkbox

Returns a new Checkbox field, optionally with an initial value (which will be false if no value is specified).

Form.Field.Date: Form.Field

No documentation available.

Constructors

new Form.Field.Date(key:String, displayName:String or null, value:Date or null)Form.Field.Date

Returns a new Date field, optionally with an initial value. The user's date formatting preference will be used to display and determine component ordering when parsing dates. Relative dates like "1d", "tomorrow", "now" can also be entered.

Form.Field.Option: Form.Field

No documentation available.

Constructors

new Form.Field.Option(key:String, displayName:String or null, options:Array of Object, names:Array of String or null, selected:Object or null)Form.Field.Option

Returns a new Option field, allowing the user to pick from a list of option objects. A list of names may also be given, which must have the same length as the options array if so. If no names are given, the objects are converted to strings for display. An initially selected object (which must be a member of the options array) may also be given.

Form.Field.String: Form.Field

A field for entering a free-form String value.

Constructors

new Form.Field.String(key:String, displayName:String or null, value:String or null)Form.Field.String

Returns a new String field, optionally with an initial value.

Function

An object that represents a JavaScript function, allowing native code to call into JavaScript or JavaScript to call into native code.

Image

No documentation available.

LigatureStyle

No documentation available.

Class Properties

var AllLigatureStyle read-only

Use all of the available ligatures.

var EssentialLigatureStyle read-only

Use ligatures that are required for proper rendering of text.

var StandardLigatureStyle read-only

Use the default ligatures for the given script.

var allArray of LigatureStyle read-only

An array of all items of this enumeration.

Locale

No documentation available.

Class Properties

var identifiersArray of String read-only

The list of known ISO locale identifiers.

Constructors

new Locale(identifier:String)Locale

No documentation available.

Instance Properties

var calendarCalendar read-only

No documentation available.

var identifierString read-only

No documentation available.

MenuItem

No documentation available.

Instance Properties

var checkedBoolean

If true, a checkmark is displayed next to the MenuItem's label.

var labelString

The string displayed to describe the MenuItem's action.

NamedStyle.List

No documentation available.

Instance Functions

function add(name:String or null)NamedStyle

Makes a new NamedStyle at the end of the NamedStyleList, and optionally assigns it a name.

function byName(name:String)NamedStyle or null

Returns the first named style that has the specified name, or null if none do.

function byIdentifier(identifier:String)NamedStyle or null

Returns the single named style with the specified identifier, or null if no style has that identifier.

function moveStyles(styles:Array of NamedStyle, position:NamedStylePosition)

Reorders the named styles within the NamedStyleList. This cannot be used to move styles between documents.

function duplicateStyles(styles:Array of NamedStyle, position:NamedStylePosition)Array of NamedStyle

No documentation available.

Instance Properties

var allArray of NamedStyle read-only

Returns the list of all NamedStyles. Note that the order determine which attribute values are applied if two named styles have conflicting settings.

var beginningNamedStylePosition read-only

Returns a NamedStylePosition that indicates the position before any existing named styles.

var endNamedStylePosition read-only

Returns a NamedStylePosition that indicates the position before after existing named styles.

NamedStylePosition

No documentation available.

ObjectIdentifier

No documentation available.

Instance Properties

var objectClassObject or null read-only

Returns the constructor object that would be used for instances of the class for this ObjectIdentifier.

var primaryKeyString read-only

Returns the primary key of the object identifier.

Pasteboard

No documentation available.

Class Functions

function makeUnique()Pasteboard

Creates a new unique pasteboard.

Class Properties

var generalPasteboard read-only

The Pasteboard used for user-initiated copy/paste support.

Perspective

No documentation available.

Perspective.BuiltIn

No documentation available.

Class Properties

var FlaggedPerspective.BuiltIn read-only

The flagged items.

var ForecastPerspective.BuiltIn read-only

The upcoming due items.

var InboxPerspective.BuiltIn read-only

The inbox of tasks.

var NearbyPerspective.BuiltIn read-only

Nearby items on a map (iOS only).

var ProjectsPerspective.BuiltIn read-only

The library of projects.

var ReviewPerspective.BuiltIn read-only

The projects needing review.

var SearchPerspective.BuiltIn read-only

A search of the database. This perspective cannot be set, but might be reported if the user is searching.

var TagsPerspective.BuiltIn read-only

The hierarchy of tags.

var allArray of Perspective.BuiltIn read-only

An array of all items of this enumeration.

PlugIn

No documentation available.

Class Functions

function find(identifier:String, minimumVersion:Version or null)PlugIn or null

No documentation available.

Class Properties

var allArray of PlugIn read-only

No documentation available.

Instance Functions

function library(identifier:String)Object or null

Looks for a PlugIn.Library in the receiver and returns it if found.

function action(identifier:String)PlugIn.Action or null

No documentation available.

function handler(identifier:String)PlugIn.Handler or null

No documentation available.

function resourceNamed(name:String)URL or null

No documentation available.

function imageNamed(name:String)Image or null

No documentation available.

Instance Properties

var URLURL or null read-only

Returns the original URL from whence this PlugIn came, if known.

var actionsArray of PlugIn.Action read-only

No documentation available.

var displayNameString read-only

Returns the localized, human-readable name for the PlugIn.

var handlersArray of PlugIn.Handler read-only

No documentation available.

var identifierString read-only

The unique identifier of the PlugIn.

var librariesArray of PlugIn.Library read-only

No documentation available.

var versionVersion read-only

Returns the current Version for the PlugIn.

PlugIn.Action

No documentation available.

Constructors

new PlugIn.Action(perform:Function)PlugIn.Action

Returns a new PlugIn.Action. Only used within an action JavaScript file embedded within a PlugIn.

Instance Properties

var nameString read-only

Returns the name of the PlugIn.Action.

var performFunction read-only

No documentation available.

var plugInPlugIn read-only

Returns the PlugIn that contains this object.

var validateFunction or null

A function to check whether the action is supported, given the current application state, as determined by the arguments passed (typically including the selection). This optional Function may be configured while the Action is being loaded, but after that the Action will be frozen.

PlugIn.Handler

No documentation available.

Constructors

new PlugIn.Handler(invoke:Function)PlugIn.Handler

Returns a new PlugIn.Handler. Only used within an handler JavaScript file embedded within a PlugIn.

Instance Properties

var invokeFunction read-only

The Function that will be executed for each handler registered for an event posted by an application object.

var nameString read-only

Returns the name of the PlugIn.Handler.

var plugInPlugIn read-only

Returns the PlugIn that contains this object.

var willAttachFunction or null

An optional Function that can be set on PlugIn.Handler as it is being loaded (but not after). This function is passed the application object that post events to trigger the handler. The return value should be a state object that is JSON archivable (or undefined if the handler has no state to maintain across invocations).

var willDetachFunction or null

An optional Function that can be set on PlugIn.Handler as it is being loaded (but not after). Called when a previously attached PlugIn.Handler is being detached from an application object. Any return value or thrown error are ignored.

PlugIn.Library

An object that represents a library from a plug-in.

Constructors

new PlugIn.Library(version:Version)PlugIn.Library

Returns a new Library. Typically only used within a library JavaScript file embedded within a PlugIn.

Instance Properties

var nameString read-only

Returns the name of the PlugIn.Library.

var plugInPlugIn read-only

Returns the PlugIn that contains this object.

var versionVersion read-only

Returns the Version of this library, as passed to the constructor.

Project.Status

No documentation available.

Class Properties

var ActiveProject.Status read-only

The project is active.

var DoneProject.Status read-only

The project has been marked as completed.

var DroppedProject.Status read-only

The project has been dropped.

var OnHoldProject.Status read-only

The project has been put on-hold.

var allArray of Project.Status read-only

An array of all items of this enumeration.

Promise

The built-in JavaScript Promise constructor.

Selection

No documentation available.

Instance Properties

var databaseDatabase or null read-only

No documentation available.

var documentDatabaseDocument or null read-only

The Document containing the selection.

var foldersArray of Folder read-only

No documentation available.

var projectsArray of Project read-only

No documentation available.

var tagsArray of Tag read-only

No documentation available.

var tasksArray of Task read-only

No documentation available.

var windowDocumentWindow or null read-only

The Window containing the selection.

Settings

Settings represent the database synchronized configuration values. NOTE: editing these should be done with care, as storing invalid values may corrupt your database or produce instability in the various client applications.

Instance Functions

function defaultObjectForKey(key:String)Object or null

No documentation available.

function hasNonDefaultObjectForKey(key:String)Boolean

No documentation available.

function objectForKey(key:String)Object or null

No documentation available.

function setObjectForKey(value:Object or null, key:String)

No documentation available.

function boolForKey(key:String)Boolean

No documentation available.

function setBoolForKey(value:Boolean, key:String)

No documentation available.

function integerForKey(key:String)Number

No documentation available.

function setIntegerForKey(value:Number, key:String)

No documentation available.

Instance Properties

var keysArray of String read-only

No documentation available.

Style

No documentation available.

Instance Functions

function set(attribute:Style.Attribute, value:Object or null)Boolean

Sets (or clears) the value for the given style attribute. Styles that cascade from this one will inherit this value, if they don't define their own value or have a closer ancestor style that does. Returns true if a change was actually made, false otherwise. Throws an error if the key does not map to a known attribute, or if the value is of the wrong type for the specified attribute.

function get(attribute:Style.Attribute)Object or null

Looks up the value for the specified style attribute locally, in the cascading and inherited styles, and finally falling back to the default value for the style attribute.

function localValueForAttribute(attribute:Style.Attribute)Object or null

Looks up the value for the specified style attribute locally, returning null if it is not set.

function addNamedStyle(namedStyle:NamedStyle)

Adds the specified NamedStyle to the set of named styles to include in this Style. If the style is already present, or if this would create a loop (adding two NamedStyles to each other's list of named styles), an error will be thrown.

function removeNamedStyle(namedStyle:NamedStyle)

Removes the specified NamedStyle from the set of named styles to include in this Style. If the style is not present, an error will be thrown.

function influencedBy(otherStyle:Style)Boolean

Returns true if the receiver is influenced, directly or indirectly from the passed Style.

function setStyle(style:Style)

Updates all the attributes and inherited styles on the receiver to be the same as the argument Style.

function clear()

Removes all the locally applied style attribute values for this Style.

Instance Properties

var fontFillColorColor

The color used to fill text. Setting the color to null will remove the setting for this style.

var linkURL or null read-only

Returns the URL link for a style, or null if there is no link applied. Note that get(Style.Attribute.Link) on the same style will return the default URL with an empty toString() value when there is no URL applied. If the style represents a file attachment and there is no specific link attribute set, the URL for the file attachment will be returned. If the style represents an file attachment that is embedded in the document, null will be returned.

var locallyDefinedAttributesArray of Style.Attribute read-only

Returns an array of the Style.Attributes defined on this Style.

var namedStylesArray of NamedStyle read-only

Returns the NamedStyles that are directly associated with this Style. If a style attribute lookup doesn't find a value in the local style, then the named styles will be searched.

NamedStyle: Style

No documentation available.

Instance Functions

function remove()

Removes the NamedStyle from the document. Any references to it are disconnected as well.

Instance Properties

var afterNamedStylePosition read-only

Returns a NamedStylePosition that indicates the slot after this item.

var beforeNamedStylePosition read-only

Returns a NamedStylePosition that indicates the slot before this item.

var identifierString read-only

A unique identifier for the style, which is suitable for long-lived references.

var nameString

The name of the style that is presented in the interface.

Style.Attribute

No documentation available.

Class Properties

var BackgroundColorStyle.Attribute read-only

No documentation available.

var BaselineOffsetStyle.Attribute read-only

No documentation available.

var BaselineSuperscriptStyle.Attribute read-only

No documentation available.

var ExpansionStyle.Attribute read-only

No documentation available.

var FontCondensedStyle.Attribute read-only

No documentation available.

var FontFamilyStyle.Attribute read-only

No documentation available.

var FontFillColorStyle.Attribute read-only

No documentation available.

var FontFixedPitchStyle.Attribute read-only

No documentation available.

var FontItalicStyle.Attribute read-only

No documentation available.

var FontNameStyle.Attribute read-only

No documentation available.

var FontNarrowStyle.Attribute read-only

No documentation available.

var FontSizeStyle.Attribute read-only

No documentation available.

var FontStrokeColorStyle.Attribute read-only

No documentation available.

var FontStrokeWidthStyle.Attribute read-only

No documentation available.

var FontWeightStyle.Attribute read-only

No documentation available.

var KerningAdjustmentStyle.Attribute read-only

No documentation available.

var LigatureSelectionStyle.Attribute read-only

No documentation available.

var LinkStyle.Attribute read-only

No documentation available.

var ObliquenessStyle.Attribute read-only

No documentation available.

var ParagraphAlignmentStyle.Attribute read-only

No documentation available.

var ParagraphBaseWritingDirectionStyle.Attribute read-only

No documentation available.

var ParagraphDefaultTabIntervalStyle.Attribute read-only

No documentation available.

var ParagraphFirstLineHeadIndentStyle.Attribute read-only

No documentation available.

var ParagraphHeadIndentStyle.Attribute read-only

No documentation available.

var ParagraphLineHeightMultipleStyle.Attribute read-only

No documentation available.

var ParagraphLineSpacingStyle.Attribute read-only

No documentation available.

var ParagraphMaximumLineHeightStyle.Attribute read-only

No documentation available.

var ParagraphMinimumLineHeightStyle.Attribute read-only

No documentation available.

var ParagraphSpacingStyle.Attribute read-only

No documentation available.

var ParagraphSpacingBeforeStyle.Attribute read-only

No documentation available.

var ParagraphTabStopsStyle.Attribute read-only

No documentation available.

var ParagraphTailIndentStyle.Attribute read-only

No documentation available.

var ShadowBlurRadiusStyle.Attribute read-only

No documentation available.

var ShadowColorStyle.Attribute read-only

No documentation available.

var ShadowOffsetStyle.Attribute read-only

No documentation available.

var StrikethroughAffinityStyle.Attribute read-only

No documentation available.

var StrikethroughColorStyle.Attribute read-only

No documentation available.

var StrikethroughPatternStyle.Attribute read-only

No documentation available.

var StrikethroughStyleStyle.Attribute read-only

No documentation available.

var UnderlineAffinityStyle.Attribute read-only

No documentation available.

var UnderlineColorStyle.Attribute read-only

No documentation available.

var UnderlinePatternStyle.Attribute read-only

No documentation available.

var UnderlineStyleStyle.Attribute read-only

No documentation available.

Instance Properties

var defaultValueObject read-only

Returns the default value that will be used when a style has no local value for this attribute, nor do any of its associated styles.

var keyString read-only

Returns the string used to identify this attribute when calling get or set on a Style instance.

Tag.ChildInsertionLocation

No documentation available.

Task.ChildInsertionLocation

No documentation available.

Task.Status

No documentation available.

Class Properties

var AvailableTask.Status read-only

The task is available to work on.

var BlockedTask.Status read-only

The task is not available to work on currently, due to a future defer date, a preceeding task in a sequential project, or having an on-hold tag associated.

var CompletedTask.Status read-only

The task is already completed.

var DroppedTask.Status read-only

The task will not be worked on.

var DueSoonTask.Status read-only

The task is incomplete and due soon.

var NextTask.Status read-only

The task is the first available task in a project.

var OverdueTask.Status read-only

The task is incomplete overdue.

var allArray of Task.Status read-only

An array of all items of this enumeration.

Text

No documentation available.

Class Functions

function makeFileAttachment(fileWrapper:FileWrapper, style:Style)Text

Returns a new Text instance that represents a file attachment. The attachment has a single character string content with a special value.

Constructors

new Text(string:String, style:Style)Text

Returns a new Text instance with the given string contents and Style applied to the entire range of text.

Instance Functions

function textInRange(range:Text.Range)Text

Returns a copy of the text in the specified range.

function styleForRange(range:Text.Range)Style

Returns a Style instance for the given range of the Text.

function ranges(component:TextComponent, useEnclosingRange:Boolean or null)Array of Text.Range

Returns an array of TextRanges for the specified component. If useEnclosingRange is true, than any extra characters that separate follow a component will be included in its range. Any extra characters before the first found component will be included in the first range.

function replace(range:Text.Range, with:Text)

Replaces the sub-range of the receiving Text with a copy of the passed in Text (which remains unchanged).

function append(text:Text)

Appends the given Text to the receiver.

function insert(position:Text.Position, text:Text)

Inserts a copy of the given Text at the specified position in the receiver.

function remove(range:Text.Range)

Removes the indicated sub-range of the receiving Text.

function find(string:String, options:Array of Text.FindOption or null, range:Text.Range or null)Text.Range or null

Finds an occurrence of string within the Text and returns the enclosing Text.Range if there is a match. If range is passed, only that portion of the Text is searched. The supplied options, if any, change how the search is performed based on their definition.

Instance Properties

var attachmentsArray of Text read-only

Returns an array of copies of the blocks of Text in the receiver that represent Attachments. Note that editing these instances will not change the original.

var attributeRunsArray of Text read-only

Returns an array of copies of the contiguous blocks of Text in the receiver that have the same style. Note that editing these instances will not change the original.

var charactersArray of Text read-only

Returns an array of copies of the characters in the Text. Note that editing these instances will not change the original.

var endText.Position read-only

Returns a Text.Position indicating the end of the Text.

var fileWrapperFileWrapper or null read-only

Returns the attached file wrapper for the Text (or rather, the first character of the text), if any.

var paragraphsArray of Text read-only

Returns an array of copies of the paragraphs in the Text. Note that editing these instances will not change the original. Paragraphs, if ended by a newline, will contain the newline character.

var rangeText.Range read-only

Returns a Text.Range that spans the entire Text.

var sentencesArray of Text read-only

Returns an array of copies of the sentences in the Text. Note that editing these instances will not change the original.

var startText.Position read-only

Returns a Text.Position indicating the beginning of the Text.

var stringString

Returns a plain String version of the characters in the Text. Note that since JavaScript represents Strings as Unicode code points, the length of the returned string may be differnt from the number of characters in the Text object.

var styleStyle read-only

Returns a Style instance for this Text object.

var wordsArray of Text read-only

Returns an array of copies of the words in the Text. Note that editing these instances will not change the original.

Text.FindOption

No documentation available.

Class Properties

var AnchoredText.FindOption read-only

Matches must be anchored to the beginning (or end if Backwards is include) of the string or search range.

var BackwardsText.FindOption read-only

Search starting from the end of the string or range.

var CaseInsensitiveText.FindOption read-only

Compare upper and lower case characters as equal.

var DiacriticInsensitiveText.FindOption read-only

Ignore diacritics. For example, "ö" is considered the same as "o".

var ForcedOrderingText.FindOption read-only

Force an ordering between strings that aren't strictly equal.

var LiteralText.FindOption read-only

Perform exact character-by-character matching.

var NumericText.FindOption read-only

Order numbers by numeric value, not lexigraphically. Only applies to ordered comparisons, not find operations.

var RegularExpressionText.FindOption read-only

For find operations, the string is treated as an ICU-compatible regular expression. If set, no other options can be used except for CaseInsensitive and Anchored.

var WidthInsensitiveText.FindOption read-only

Ignore width differences. For example, "a" is considered the same as 'FULLWIDTH LATIN SMALL LETTER A' (U+FF41).

var allArray of Text.FindOption read-only

An array of all items of this enumeration.

Text.Position

No documentation available.

Text.Range

No documentation available.

Constructors

new Text.Range(start:Text.Position, end:Text.Position)Text.Range

No documentation available.

Instance Properties

var endText.Position read-only

Returns the Text.Position for the end of the Text.Range

var isEmptyBoolean read-only

Returns true if the Text.Range contains no characters.

var startText.Position read-only

Returns the Text.Position for the beginning of the Text.Range

TextAlignment

No documentation available.

Class Properties

var CenterTextAlignment read-only

Visually center aligned.

var JustifiedTextAlignment read-only

Fully-justified.

var LeftTextAlignment read-only

Visually left aligned.

var NaturalTextAlignment read-only

Use the default alignment based on the characters in the text.

var RightTextAlignment read-only

Visually right aligned.

var allArray of TextAlignment read-only

An array of all items of this enumeration.

TextComponent

No documentation available.

Class Properties

var AttachmentsTextComponent read-only

The ranges of Text which represent Attachments.

var AttributeRunsTextComponent read-only

The ranges of Text which have the same attributes.

var CharactersTextComponent read-only

The individual characters of the Text. Note that some characters (like emoji) consist of multiple Unicode code points.

var ParagraphsTextComponent read-only

The paragraphs of Text. Unlike other options, the line breaking characters that end the paragraph are included.

var SentencesTextComponent read-only

The sentences of the Text.

var WordsTextComponent read-only

The words in the Text. Whitespace or other word break characters are not included.

var allArray of TextComponent read-only

An array of all items of this enumeration.

TimeZone

No documentation available.

Class Properties

var abbreviationsArray of String read-only

The list of known time zone abbreviations.

Constructors

new TimeZone(abbreviation:String)TimeZone or null

Make a new TimeZone with the given abbreviation. Note that the returned TimeZone may have a different abbreviation than the passed argument. For example, if one of "PST" or "PDT" is requested that doens't match the current use of daylight savings time, the one that does match will be returned.

Instance Properties

var abbreviationString or null read-only

The abbreviation for the TimeZone.

var daylightSavingTimeBoolean read-only

Returns true if the TimeZone is currently using daylight savings time.

var secondsFromGMTNumber read-only

The current difference in seconds between this TimeZone and GMT.

Timer

No documentation available.

Class Functions

function once(interval:Number, action:Function)Timer

Makes a new Timer that will fire once, after the specified interval (in seconds from the current time). When the Timer fires, the passed in Function is called, passing the Timer as its argument.

function repeating(interval:Number, action:Function)Timer

Makes a new Timer that will fire repeatedly with the specified interval (in seconds, with the first invocation happening that interval after the current time). When the Timer fires, the passed in Function is called, passing the Timer as its argument.

Instance Functions

function cancel()

No documentation available.

Instance Properties

var intervalNumber read-only

No documentation available.

ToolbarItem

No documentation available.

Instance Properties

var imageImage or null

No documentation available.

var labelString

No documentation available.

var toolTipString or null

No documentation available.

Tree

No documentation available.

Instance Functions

function nodeForObject(object:Object)TreeNode or null

Returns the TreeNode that represents the object in this Tree, or null if it cannot be found (possibly filtered out).

function nodesForObjects(object:Array of Object)Array of TreeNode

Returns an array of TreeNodes for the objects that are currently in the Tree, according to the same filters as nodeForObject(). The size of the resulting node array may be smaller (even empty) than the passed in objects array.

function reveal(nodes:Array of TreeNode)

Ensures the ancestor nodes of all the specified nodes are expanded.

function select(nodes:Array of TreeNode, extending:Boolean or null)

Selects the specified TreeNodes that are visible (nodes with collapsed ancestors cannot be selected). If extending is true, the existing selection is not cleared.

Instance Properties

var rootNodeTreeNode read-only

Returns the rootNode of the Editor.

var selectedNodesArray of TreeNode read-only

Returns the list of selected TreeNodes, in the order they appear in the tree.

ContentTree: Tree

No documentation available.

SidebarTree: Tree

No documentation available.

TreeNode

No documentation available.

Instance Functions

function expand(completely:Boolean or null)

Attempts to expand the TreeNode. If completely is passed, all the child nodes will be expanded as they allow.

function collapse(completely:Boolean or null)

Attempts to collapse the TreeNode. If completely is passed, all the child nodes will be collapse as they allow.

function expandNote(completely:Boolean or null)

Attempts to expand the inline note of the TreeNode. If completely is passed, all the child node notes will be expanded.

function collapseNote(completely:Boolean or null)

Attempts to collapse the inline note of the TreeNode. If completely is passed, all the child node notes will be collapsed.

function reveal()

Expands all the

function apply(function:Function)

Calls the supplied function for each TreeNode in the receiver (including the receiver), passing that node as the single argument.

Instance Properties

var canCollapseBoolean read-only

Returns true if this TreeNode can be collapsed.

var canExpandBoolean read-only

Returns true if this TreeNode can be expanded.

var childrenArray of TreeNode read-only

Returns the array of children that are visible under this node, according to any filtering that is being done, and in the order specified by any sorting rules that have been established.

var indexNumber read-only

Returns the index of this TreeNode among its siblings, or zero for the rootNode.

var isExpandedBoolean read-only

Returns true if this TreeNode is currently expanded.

var isNoteExpandedBoolean read-only

Returns true if the note of this TreeNode is currently expanded.

var isRevealedBoolean read-only

Returns true if the TreeNode is the rootNode or all of its ancestor nodes are expanded.

var isRootNodeBoolean read-only

Returns true if this node is the rootNode of its tree.

var isSelectableBoolean read-only

Returns true if this TreeNode can be selected. The rootNode cannot be selected, nor can nodes that aren't revealed.

var isSelectedBoolean

Set to true if this TreeNode is in the list of selected nodes for its tree. Attempting to set this to true will do nothing if the node is not revealed (or is the root node).

var levelNumber read-only

Returns the nesting level of the TreeNode, relative to the root of the tree. The rootNode of an Outline has level zero, its children have level one, and so on. Note that if only a portion of the model is being shown, this level may not match the level of the underlying object.

var objectObject read-only

The model object which this node wraps.

var parentTreeNode or null read-only

Returns the TreeNode that contains this node, or null if this is the rootNode.

var rootNodeTreeNode read-only

Returns the root TreeNode for the tree that this node belongs to.

URL

No documentation available.

Class Functions

function choose(types:Array of String)URL or null

Deprecated: Please use FilePicker instead.

Allows the user to choose a file URL if possible and returns a new instance, or null otherwise.

function chooseFolder()URL or null

Deprecated: Please use FilePicker instead.

Allows the user to choose a folder URL if possible and returns a new instance, or null otherwise.

function fromString(string:String)URL or null

Parses the string as a URL if possible and returns a new instance, or null otherwise.

function tellScript(app:String, js:String, arg:Object or null)URL or null

Creates a URL to invoke the given JS on the given app (url scheme) appropriate for use with the call function.

function tellFunction(app:String, jsFunction:Function, arg:Object or null)URL or null

Creates a URL to invoke the given JS function on the given app (url scheme) appropriate for use with the call function.

Instance Functions

function fetch(success:Function, failure:Function or null)

Get the contents at the destination of this URL.

function call(success:Function, failure:Function or null)

No documentation available.

function toString()String

No documentation available.

Instance Properties

var stringString read-only

String representation of this URL.

var toObjectObject or null read-only

No documentation available.

UnderlineAffinity

No documentation available.

Class Properties

var ByWordUnderlineAffinity read-only

Underline only the words, but not the space between them.

var NoneUnderlineAffinity read-only

Underline the entire range.

var allArray of UnderlineAffinity read-only

An array of all items of this enumeration.

UnderlinePattern

No documentation available.

Class Properties

var DashUnderlinePattern read-only

Dashed line.

var DashDotUnderlinePattern read-only

Alternating dashes and dots.

var DashDotDotUnderlinePattern read-only

Alternating dashes and pairs of dots.

var DotUnderlinePattern read-only

Dotted line.

var SolidUnderlinePattern read-only

A continuous line.

var allArray of UnderlinePattern read-only

An array of all items of this enumeration.

UnderlineStyle

No documentation available.

Class Properties

var DoubleUnderlineStyle read-only

Two lines.

var NoneUnderlineStyle read-only

No underline.

var SingleUnderlineStyle read-only

A single line.

var ThickUnderlineStyle read-only

A single thick line.

var allArray of UnderlineStyle read-only

An array of all items of this enumeration.

Version

No documentation available.

Constructors

new Version(versionString:String)Version

Parses a string representation of a Version and returns an instance, or throws an error if the string isn't a valid version.

Instance Functions

function equals(version:Version)Boolean

Returns true if the receiving Version is equal to the argument Version.

function atLeast(version:Version)Boolean

Returns true if the receiving Version is at the same as or newer than the argument Version.

function isAfter(version:Version)Boolean

Returns true if the receiving Version is strictly after the argument Version.

function isBefore(version:Version)Boolean

Returns true if the receiving Version is strictly before the argument Version.

Instance Properties

var versionStringString read-only

Returns as an opaque string representation of the Version, suitable for display or logging. This should never be used in comparisons of any sort.

Window

No documentation available.

Instance Functions

function close()

No documentation available.

DocumentWindow: Window

No documentation available.

Instance Properties

var contentContentTree or null read-only

The tree of nodes representing the content area of the window.

var focusArray of Project or Folder or null

The Folders and Projects that the window is focusing on, limiting the sidebar to show only these items.

var perspectivePerspective.BuiltIn or Perspective.Custom or null

No documentation available.

var selectionSelection read-only

No documentation available.

var sidebarSidebarTree or null read-only

The tree of nodes representing the sidebar of the window.