AlertAn alert interface for displaying information to the user, blocking further interaction until the alert is dismissed.
new Alert(title: String, message: String) → AlertCreate a new alert panel with the given title and text contents.
function show(callback: Function(option: Number) or null) → Promise of NumberDisplays the alert. 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.
ApplicationAn object representing the OmniGraffle application itself. The type of the global variable app.
function openDocument(from: Document or null, url: URL, completed: Function(documentOrError: Document or Error, alreadyOpen: Boolean))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.
var buildVersion → Version read-onlyThe internal build version number for the app. See also userVersion.
var commandKeyDown → Boolean read-onlyWhether the Command key is currently down.
var controlKeyDown → Boolean read-onlyWhether the Control key is currently down.
var name → String read-onlyApplication name.
var optionKeyDown → Boolean read-onlyWhether the Option key is currently down.
var platformName → String read-onlyReturns a string describing the current platform, currently "iOS" or "macOS".
var shiftKeyDown → Boolean read-onlyWhether the Shift key is currently down.
var stencils → Array of Stencil read-onlyList of stencils that OmniGraffle currently has available.
var userVersion → Version read-onlyThe user-visible version number for the app. See also buildVersion.
var version → String read-onlyDeprecated: Recommend using either userVersion or buildVersion.
For backwards compatibility with existing scripts, this returns the same result as buildVersion.versionString. We recommend using either the user-visible userVersion or the internal buildVersion instead, which are more clear about which version they’re returning and provide their results as Version objects which can be semantically compared with other Version objects.
ArrayThe built-in JavaScript Array constructor.
Audiofunction playAlert(alert: Audio.Alert or null, completed: Function() or null)Play the specified Audio.Alert. On macOS, if no alert is specified, the user’s default alert sound will be played. On iOS, there is no default alert sound and nothing will be done without specifying an alert.
Audio.Alertnew Audio.Alert(url: URL) → Audio.AlertCalendarvar buddhist → Calendar read-onlyvar chinese → Calendar read-onlyvar coptic → Calendar read-onlyvar current → Calendar read-onlyThe user’s preferred calendar
var ethiopicAmeteAlem → Calendar read-onlyvar ethiopicAmeteMihret → Calendar read-onlyvar gregorian → Calendar read-onlyThe Gregorian calendar.
var hebrew → Calendar read-onlyvar indian → Calendar read-onlyvar islamic → Calendar read-onlyvar islamicCivil → Calendar read-onlyvar islamicTabular → Calendar read-onlyvar islamicUmmAlQura → Calendar read-onlyvar iso8601 → Calendar read-onlyvar japanese → Calendar read-onlyvar persian → Calendar read-onlyvar republicOfChina → Calendar read-onlyfunction dateByAddingDateComponents(date: Date, components: DateComponents) → Date or nullReturns a new Date by adding the given DateComponents, or null if no date could be calculated.
function dateFromDateComponents(components: DateComponents) → Date or nullReturns a new Date from the given DateComponents, or null if no date could be calculated.
function dateComponentsFromDate(date: Date) → DateComponentsReturns a new DateComponents for the given Date.
function dateComponentsBetweenDates(start: Date, end: Date) → DateComponentsReturns the difference from the start Date to the end Date as a DateComponents.
function startOfDay(date: Date) → DateReturns a Date for the first moment of the day containing the given Date according to this Calendar.
var identifier → String read-onlyThe ISO identifier for the calendar.
var locale → Locale or null read-onlyThe locale of the calendar.
var timeZone → TimeZone read-onlyThe time zone of the calendar.
Canvasfunction layout()Perform automatic layout of all graphics on this canvas.
function layoutGraphics(graphics: Array of Graphic)Perform automatic layout of only the given graphics (all of which need to be on this canvas).
function addShape(shapeName: String, bounds: Rect) → ShapeCreate a new graphic of a given shape and place it on the first visible and unlocked layer.
function newShape() → ShapeCreate a zero-sized rectangle (presumably to be modified further) and place it on the first visible and unlocked layer.
function newLayer() → LayerCreate a new (top-most) layer.
function addLine(start: Point, end: Point) → LineCreate a new line between two points and place it on the first visible layer.
function newLine() → LineCreate a new zero-length line (presumably to be modified further) and place it on the first visible layer.
function addText(text: String, origin: Point) → SolidCreate a new shape containing text (with no stroke or shadow) and place it on the first visible layer.
function connect(from: Graphic, to: Graphic) → LineCreate a new line connecting two existing graphics.
function duplicate(graphics: Array of Graphic) → Array of GraphicDuplicate existing graphics onto new graphics placed upon this canvas. The original graphics may be from elsewhere - such as from another canvas, a stencil, or another document.
function orderBefore(model: Canvas)Reorder this canvas to be before another canvas in this document.
function orderAfter(model: Canvas)Reorder this canvas to be after another canvas in this document.
function remove()Remove this canvas from the document, deleting it.
function graphicWithId(id: Number) → Graphic or nullGet the graphic with the given id, if it exists on this canvas.
function graphicWithName(name: String) → Graphic or nullGet the first graphic with the given name, if any. Note that most graphics do not have names unless they are explicitly set; instead they will be displayed using a placeholder string (such as “Rectangle”) in the outline.
function allGraphicsWithUserDataForKey(data: String, key: String) → Array of GraphicGet all graphics with the given data string for the user data key.
function graphicWithUserDataForKey(data: String, key: String) → Graphic or nullGet the first graphic with the given data string for the user data key, if any.
function combine(shapes: Array of Shape, operation: ShapeCombination, replaceOriginal: Boolean or null) → Shape or nullfunction onGraphicChanged(handler: PlugIn.Handler) → PlugIn.Handler.Registration or nullA handler called when any graphic on this canvas changes any properties.
var autosizesDown → BooleanShould the canvas automatically grow when graphics are added below the current bounds.
var autosizesLeft → BooleanShould the canvas automatically grow when graphics are added to the left of the current bounds.
var autosizesRight → BooleanShould the canvas automatically grow when graphics are added to the right of the current bounds.
var autosizesUp → BooleanShould the canvas automatically grow when graphics are added above the current bounds.
var background → Solid read-onlyA solid graphic representing the canvas background. Its fill and image properties determine the canvas background appearance.
var canvasSizeIsMeasuredInPages → Booleanvar canvasSizingMode → CanvasSizingModevar columnAlignment → VerticalAlignmentSetting for how graphics ought to be aligned vertically.
var graphics → Array of Graphic read-onlyAll graphics upon this canvas.
var grid → Grid read-onlySettings for the major and minor grids, if any.
var horizontalPages → NumberNumber of printer pages wide.
var id → Number read-onlyA unique (within this document) identifying number for this canvas.
var layers → Array of Layer read-onlyAll layers of this canvas.
var layoutInfo → Layout read-onlyThe automatic layout information describing how graphics should be arranged.
var name → StringThe title of this canvas.
var outlineRoot → OGOutlineNode read-onlyBuilds a model of all shapes in the canvas as a hierarchical outline (as in hierarchical auto layout) and returns the root of that outline.
var pageSize → Size read-onlySize of each page in points.
var rowAlignment → HorizontalAlignmentSetting for how graphics ought to be aligned horizontally.
var shapes → Array of Shape read-onlyvar size → SizeOverall size in points.
var spaceBetweenObjectsInColumn → NumberSetting for how graphics ought to be spaced out vertically.
var spaceBetweenObjectsInRow → NumberSetting for how graphics ought to be spaced out horizontally.
var verticalPages → NumberNumber of printer pages tall.
CanvasSizingModevar Fit → CanvasSizingMode read-onlyResizes to fit its contents.
var Fixed → CanvasSizingMode read-onlySpecific size in pages or in points.
var Infinite → CanvasSizingMode read-onlyNo specific size and no canvas edges.
var all → Array of CanvasSizingMode read-onlyColorfunction RGB(r: Number, g: Number, b: Number, a: Number or null) → ColorMakes 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) → ColorMakes 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) → ColorMakes a new color in the White colorspace, with the given components. If the alpha component is not given, 1.0 is used.
var black → Color read-onlyA color in the White colorspace with white component of 0.0.
var blue → Color read-onlyA color in the RGB colorspace with components (0, 0, 1, 1).
var brown → Color read-onlyA color in the RGB colorspace with components (0.6, 0.4, 0.2, 1).
var clear → Color read-onlyA color in the White colorspace with white component of 0.0 and alpha of 0.0 (“transparent black”).
var cyan → Color read-onlyA color in the RGB colorspace with components (0, 1, 1, 1).
var darkGray → Color read-onlyA color in the White colorspace with white component of 0.333.
var gray → Color read-onlyA color in the White colorspace with white component of 0.5.
var green → Color read-onlyA color in the RGB colorspace with components (0, 1, 0, 1).
var lightGray → Color read-onlyA color in the White colorspace with white component of 0.667.
var magenta → Color read-onlyA color in the RGB colorspace with components (1, 0, 1, 1).
var orange → Color read-onlyA color in the RGB colorspace with components (1, 0.5, 0, 1).
var purple → Color read-onlyA color in the RGB colorspace with components (1, 0, 1, 1).
var red → Color read-onlyA color in the RGB colorspace with components (1, 0, 0, 1).
var white → Color read-onlyA color in the White colorspace with white component of 1.0.
var yellow → Color read-onlyA color in the RGB colorspace with components (1, 1, 0, 1).
function blend(otherColor: Color, fraction: Number) → Color or nullReturns 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.
var alpha → Number read-onlyReturns the alpha component of the color.
var blue → Number read-onlyReturns the blue component of the color, after converting to a RGB colorspace.
var brightness → Number read-onlyReturns the brightness component of the color, after converting to a HSB colorspace.
var colorSpace → ColorSpace read-onlyReturns the colorspace of the instance.
var green → Number read-onlyReturns the green component of the color, after converting to a RGB colorspace.
var hue → Number read-onlyReturns the hue component of the color, after converting to a HSB colorspace.
var red → Number read-onlyReturns the red component of the color, after converting to a RGB colorspace.
var saturation → Number read-onlyReturns the saturation component of the color, after converting to a HSB colorspace.
var white → Number read-onlyReturns the white component of the color, after converting to a White colorspace.
ColorSpacevar CMYK → ColorSpace read-onlyA colorspace with cyan, magenta, yellow, black, and alpha components.
var HSB → ColorSpace read-onlyA colorspace with hue, saturation, and value (or brightness) components.
var Named → ColorSpace read-onlyA space for named colors, like system defined colors, or specific color palette spaces.
var Pattern → ColorSpace read-onlyA colorspace that wraps a pattern image.
var RGB → ColorSpace read-onlyThe sRGB colorspace with red, green, blue, and alpha components.
var White → ColorSpace read-onlyA colorspace with white and alpha components.
var all → Array of ColorSpace read-onlyConsoleThe 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.
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)function info(message: Object, additional: Array of Object or null)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.
CredentialsThe Credentials class allows storage of private username and password pairs, URL.Bookmark instances, and possibly other sensitive information in the future. Instances are tied to a single plug-in and single application, and may only be created in plug-ins when they are being loaded.
For example, when a PlugIn.Action is being created, you could use the following pattern:
 (() => {
     let credentials = new Credentials();
     var action = new PlugIn.Action(function(selection) {
         // ... use the captured credentials ...
     });
     return action;
 })();
Attempts to create Credential instances elsewhere will throw an error. Care should be taken to store instances in anonymous closures as above, and not pass them to or store them on other objects.
Credentials are keyed off a service identifier, which your plug-in can define however it likes.
new Credentials() → CredentialsCreates a new Credentials instance for the currently loading plug-in. Throws an error if called outside of plug-in loading.
function read(service: String) → Object or nullLooks up the current credentials for a given service identifier. If credentials have previously been stored, an object will be returned containing "user" an "password" properties.
function write(service: String, username: String, password: String)Creates or updates an existing credential, storing the username and password for this service securely in the Keychain.
function remove(service: String)Deletes any currently stored credentials for the specified service, either a username and password or a URL bookmark.
function readBookmark(service: String) → URL.Bookmark or nullReads the entry for the given service identifier and attempts to return it as a URL.Bookmark, or null if no such entry exists.
function writeBookmark(service: String, bookmark: URL.Bookmark)Stores the URL.Bookmark persistently for later access.
CryptoCrypto provides access to some of Apple’s CryptoKit
function randomData(length: Number) → DataCopy length bytes of cryptographically secure random data.
Crypto.SHA256The SHA–256 hash function.
new Crypto.SHA256() → Crypto.SHA256Create a new SHA–256 digest.
function update(data: Data)Incrementally update the digest with the given data.
function finalize() → DataFinalize any remaining digest process and return the result of the hash function.
Crypto.SHA384The SHA–384 hash function.
new Crypto.SHA384() → Crypto.SHA384Create a new SHA–384 digest.
function update(data: Data)Incrementally update the digest with the given data.
function finalize() → DataFinalize any remaining digest process and return the result of the hash function.
Crypto.SHA512The SHA–512 hash function.
new Crypto.SHA512() → Crypto.SHA512Create a new SHA–512 digest.
function update(data: Data)Incrementally update the digest with the given data.
function finalize() → DataFinalize any remaining digest process and return the result of the hash function.
DataA generic bag of bytes. Mainly useful to be interpreted / converted to some other type.
function fromString(string: String, encoding: StringEncoding or null) → DataConvert the string to a Data using the given encoding, or UTF8 if none is specified.
function fromBase64(string: String) → Datafunction toString(encoding: StringEncoding or null) → StringConvert to a String, assuming that this Data using the specified encoding, or UTF8 if none is given.
function toBase64() → StringConvert to a Base–64 encoded string.
var length → Number read-onlyNumber of bytes in this data.
var toObject → Object or null read-onlyDateComponentsnew DateComponents() → DateComponentsvar date → Date or null read-onlyvar day → Number or nullvar era → Number or nullvar hour → Number or nullvar minute → Number or nullvar month → Number or nullvar nanosecond → Number or nullvar second → Number or nullvar timeZone → TimeZone or nullvar year → Number or nullDecimalThe 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.
function fromString(string: String) → DecimalParses the given string into a Decimal. If the string cannot be parsed, notANumber is returned.
var maximum → Decimal read-onlyReturns the maximum representable Decimal value.
var minimum → Decimal read-onlyReturns the minimum representable Decimal value.
var notANumber → Decimal read-onlyReturns a Decimal that represents a non-number value. Any arithmetic operations involving non-number values will return notANumber.
var one → Decimal read-onlyReturns a Decimal representing one.
var zero → Decimal read-onlyReturns a Decimal representing zero.
function toString() → StringConverts the Decimal to a String representation.
function add(number: Decimal) → DecimalGenerates a new Decimal by adding the argument and the receiver.
function subtract(number: Decimal) → DecimalGenerates a new Decimal by subtracting the argument from the receiver.
function multiply(number: Decimal) → DecimalGenerates a new Decimal by multiplying the argument and the receiver.
function divide(number: Decimal) → DecimalGenerates a new Decimal by dividing the receiver by the argument.
function compare(number: Decimal) → NumberCompares 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) → BooleanReturns true if the receiver and argument represent the same number (or both are notANumber), and false otherwise.
Devicevar current → Device read-onlyThe device the current application is running on.
var iOS → Boolean read-onlyA convenience that returns true on iPhone and iPad devices
var iPad → Boolean read-onlyA convenience that returns true only on iPad devices, but not on iPhone devices.
var mac → Boolean read-onlyA convenience that returns true only on Mac devices.
var operatingSystemVersion → Version read-onlyThe current operation system version running on the device
var type → DeviceType or null read-onlyThe general type of the current device
var visionPro → Boolean read-onlyA convenience that returns true only on Apple Vision Pro devices.
DeviceTypevar all → Array of DeviceType read-onlyvar iPad → DeviceType read-onlyAn iPad
var iPhone → DeviceType read-onlyAn iPhone
var mac → DeviceType read-onlyA Mac device
var visionPro → DeviceType read-onlyAn Apple Vision Pro
Documentfunction makeNew(resultFunction: Function(document: Document or Error) or null) → Promise of DocumentCreate 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. resultFunction is executed before any functions tethered to the result Promise are executed. Returns a Promise that will yield the new document or an error.
function makeNewAndShow(resultFunction: Function(document: Document or Error) or null) → Promise of DocumentCreate a new document and presents it. Returns a Promise that will yield the new document or an error.
function close(didCancel: Function(document: Document) 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) → FileWrapperDeprecated: 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 of FileWrapperGenerates 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(completed: 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. Calls the completion function once the document is shown.
var canRedo → Boolean read-onlyWhether there are currently any actions that can be redone.
var canUndo → Boolean read-onlyWhether there are currently any actions that can be undone.
var fileType → String or null read-onlyThe file type identifier the document uses when saving, if set.
var name → String or null read-onlyDocument name.
var writableTypes → Array of String read-onlyA list of all of the file types that this document can be written as.
GraffleDocument : DocumentAn OmniGraffle document.
function addLocalizations(text: String)var portfolio → Portfolio read-onlyvar windows → Array of NSWindow read-onlyEmailA set of parameters for generating an email.
new Email() → Emailfunction 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.
var blindCarbonCopy → String or Array of String or nullvar body → String or nullvar carbonCopy → String or Array of String or nullvar fileWrappers → Array of FileWrappervar receiver → String or Array of String or nullvar subject → String or nullErrorThe built-in JavaScript Error constructor.
var causedByUserCancelling → Boolean read-onlyReturns true for errors that are caused by the user cancelling an operation. For example, if the user selects the Cancel button in a FilePicker, the Promise will signal an error that reflects this.
FilePickerA FilePicker allows the user to select URLs for files via the system-supplied file picking interface.
new FilePicker() → FilePickerReturns a new FilePicker with default settings.
function show() → Promise of Array of URLPresents 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.
var folders → BooleanIf true, then folders may be selected, but not files. In this case, types is ignored. Defaults to false.
var message → StringA message to display describing what files are being picked. This is currently only supported on macOS.
var multiple → BooleanIf true, then multiple files may be selected. Defaults to false.
var types → Array of TypeIdentifier or nullThe file types that will be allowed. If null, all file types will be allowed. Defaults to null.
FileSaverA FileSaver allows the user to save a FileWrapper to a URLs via the system-supplied file picking interface.
new FileSaver() → FileSaverReturns a new FileSaver with default settings.
function show(fileWrapper: FileWrapper) → Promise of URLPresents 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.
var message → StringA message to display describing what file is being saved. This is currently only supported on macOS.
var nameLabel → StringThe label shown next to the user-editable file name field. This is currently only supported on macOS.
var prompt → StringThe prompt shown on the the save button. This is currently only supported on macOS.
var types → Array of TypeIdentifier or nullThe file types that will be allowed. If null, all file types will be allowed. Defaults to null.
FileWrapperfunction withContents(name: String or null, contents: Data) → FileWrapperReturns a new FileWrapper that represents a flat file containing the given data.
function withChildren(name: String or null, children: Array of FileWrapper) → FileWrapperReturns a new FileWrapper that represents a directory with the given child file wrappers. Each child file wrapper must have a unique name specified.
function fromURL(url: URL, options: Array of FileWrapper.ReadingOptions or null) → FileWrapperReads a FileWrapper from an existing URL.
function childNamed(name: String) → FileWrapper or nullReturns the child file wrapper with the specified name, or null if the receiver is not a directory or doesn’t have a child with that name.
function filenameForChild(child: FileWrapper) → String or nullReturns 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.
function write(url: URL, options: Array of FileWrapper.WritingOptions or null, originalContentsURL: URL or null)Writes the FileWrapper to the given URL.
 NOTE: Any existing file or folder at the desination URL will be replaced. Care must be taken when developing scripts to avoid unintended data loss.
var children → Array of FileWrapper read-onlyReturns an Array of child FileWrappers, if this represents a directory. Otherwise, an empty array is returned.
var contents → Data or null read-onlyReturns the regular file contents of the wrapper, if this represents a regular file. Otherwise, null is returned.
var destination → URL or null read-onlyReturns the destination if this represents a symbolic link. Otherwise, null is returned.
var filename → String or nullReturns 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 preferredFilename → String or nullReturns 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 type → FileWrapper.Type read-onlyReturns the type of this FileWrapper.
FileWrapper.ReadingOptionsvar Immediate → FileWrapper.ReadingOptions read-onlyWhether the contents are read immediately, or (by default) as the file wrappers are accessed.
var WihtoutMapping → FileWrapper.ReadingOptions read-onlyAllow disabling file mapping.
var all → Array of FileWrapper.ReadingOptions read-onlyFileWrapper.Typevar Directory → FileWrapper.Type read-onlyA FileWrapper that represents a directory with zero or more child wrappers.
var File → FileWrapper.Type read-onlyA FileWrapper that represents a regular file with data contents.
var Link → FileWrapper.Type read-onlyA FileWrapper that represents a symbolic link to another location.
var all → Array of FileWrapper.Type read-onlyFileWrapper.WritingOptionsvar Atomic → FileWrapper.WritingOptions read-onlyWrite the entire FileWrapper atomically, so that either the entire file package is replaced or none of it is.
var UpdateNames → FileWrapper.WritingOptions read-onlyOn successful writing, update the filename of each file wrapper recursively so that following writes can use performance optimizations using hard links.
var all → Array of FileWrapper.WritingOptions read-onlyFillTypevar EvenOdd → FillType read-onlyEven/odd rule Solid.
var Gradient → FillType read-onlyGradient.
var Linear → FillType read-onlyLinear Gradient.
var Marker → FillType read-onlyMarker.
var None → FillType read-onlyNo Fill.
var Plastic → FillType read-onlyPlastic.
var Radial → FillType read-onlyRadial Gradient.
var Solid → FillType read-onlySolid.
var Squiggle → FillType read-onlySquiggle.
var Stipple → FillType read-onlyStipple.
var all → Array of FillType read-onlyFormForm 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.
new Form() → Formfunction 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 theForm. Any entry in thevalues` for this field will be removed as well.
function show(title: String, confirmTitle: String) → Promise of FormPresent the Form to the user, and return a Promise to be fullfilled or rejected when the user commits or cancels the form.
var fields → Array of Form.Field read-onlyThe current Field instances in the form, which will be visible to the user entering input.
var validate → Function(Form: Form) → Boolean or nullA 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 or null to perform default validation. 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. If no validate function is specified or it returns null, some per-field default validation will be performed (see Form.Field.Option. If the validate function returns a boolean result, no default validation will be performed.
var values → Object read-onlyAn object with the collected values for each field, stored under the key for that field.
Form.FieldA 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.
var displayName → String or null read-onlyHuman readable string used as the label for this field.
var key → String read-onlyKey to use when storing the value for this field in the containing form’s values object.
Form.Field.Checkbox : Form.Fieldnew Form.Field.Checkbox(key: String, displayName: String or null, value: Boolean or null) → Form.Field.CheckboxReturns a new Checkbox field, optionally with an initial value (which will be false if no value is specified).
Form.Field.Date : Form.Fieldnew Form.Field.Date(key: String, displayName: String or null, value: Date or null, formatter: Formatter.Date or null) → Form.Field.DateReturns a new Date field, optionally with an initial value, and optionally a date formatter. If no formatter is specified, a default one will be created that follows the user’s date formatting preferences to display and determine component ordering when parsing dates. Relative dates like “1d”, “tomorrow”, “now” can also be entered.
Form.Field.MultipleOptions : Form.Fieldnew Form.Field.MultipleOptions(key: String, displayName: String or null, options: Array of Object, names: Array of String or null, selected: Array of Object) → Form.Field.MultipleOptionsReturns a new MultipleOptions field, allowing the user to pick multiple items 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 array of zero or more initially selected objects (which must be members of the options array) may also be given. An empty array is valid input for the initially selected items. Additionally, it is valid for MultipleOptions fields to have a value that is an empty array.
Form.Field.Option : Form.Fieldnew Form.Field.Option(key: String, displayName: String or null, options: Array of Object, names: Array of String or null, selected: Object or null, nullOptionTitle: String or null) → Form.Field.OptionReturns 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. If the field is not configured to allow a null value and no initially selected value is specified, the user must select a value before the field is considered valid under the default form validation.
var allowsNull → BooleanIf set to true, an option will be added to allow selecting null.
var nullOptionTitle → String or nullIf null is allowed, this will be used for the title of that option. Otherwise a default title will be used.
Form.Field.Password : Form.FieldA field for text-based input, optionally using a Formatter to convert the string value into a different type.
new Form.Field.Password(key: String, displayName: String or null, value: String or null) → Form.Field.PasswordReturns a new Password field, optionally with an initial value. The displayed text will be obscured.
Form.Field.String : Form.FieldA field for text-based input, optionally using a Formatter to convert the string value into a different type.
new Form.Field.String(key: String, displayName: String or null, value: Object or null, formatter: Formatter or null) → Form.Field.StringReturns a new String field, optionally with an initial value and formatter. If a formatter is specified, the value should be of the output type from the formatter or null. If no formatter is specified, the value should be a string or null.
FormatterFormatter.Date : Formatterfunction withStyle(dateStyle: Formatter.Date.Style, timeStyle: Formatter.Date.Style or null) → Formatter.DateA formatter that will display dates according to the specified date and time formats selected in system settings.
function withFormat(format: String) → Formatter.DateReturns a formatter with a specific ICU date format and the user’s current locale, calendar, and timeZone. See http://userguide.icu-project.org/formatparse/datetime/ for details on date format strings.
var iso8601 → Formatter.Date read-onlyReturn a date formatter that produces ISO–8601 formatted dates, using the Gregorian calendar and the UTC time zone.
function stringFromDate(date: Date) → Stringfunction dateFromString(string: String) → Date or nullvar calendar → Calendarvar dateFormat → String read-onlyvar locale → Localevar timeZone → TimeZoneFormatter.Decimal : FormatterThis formatter class formats and parses Decimal-valued strings (note, not Number values).
function currency(code: String or null) → Formatter.DecimalReturns a new formatter that will display the value as a currency value. An ISO currency code may be specified to pick a specific currency, or null may be passed to use the default currency for the user’s locale. If the argument is not a valid currency code, an error will be thrown.
var currencyCodes → Array of String read-onlyDeprecated: Please use the currencyCode property on Locale instead.
 Returns the list of known ISO currency codes
var custom → Formatter.Decimal read-onlyReturns a new formatter that can be configured with custom settings.
var decimal → Formatter.Decimal read-onlyReturns a new number formatter that will use both a decimal separator.
var percent → Formatter.Decimal read-onlyReturns a new number formatter that will display the value as a percentage.
var percentWithDecimal → Formatter.Decimal read-onlyReturns a new number formatter that will display the value as a percentage with a decimal separator.
var plain → Formatter.Decimal read-onlyReturns a new number formatter that will not use any separators.
var thousandsAndDecimal → Formatter.Decimal read-onlyReturns a new number formatter that will use both a thousands and decimal separator.
function stringFromDecimal(number: Decimal) → String or nullFormat a Decimal as a string, based on the rules set on the formatter.
function decimalFromString(string: String) → Decimal or nullParses a Decimal from a string, based on the rules set on the formatter. Returns null if the value was not recognized.
var decimalSeparator → StringThe string to display between the whole portion of a number and the decimal portion.
var negativeFormat → StringA format string to use for negative values.
var positiveFormat → StringA format string to use for positive values.
var thousandsSeparator → String or nullThe string to display between groups of digits representing powers of a thousand.
var zeroSymbol → String or nullThe string to use when displaying a zero value. If this is null, the positiveFormat is used.
Formatter.Duration : Formatternew Formatter.Duration() → Formatter.Durationfunction stringFromDecimal(number: Decimal) → String or nullfunction decimalFromString(string: String) → Decimal or nullvar hoursPerDay → Numbervar hoursPerWeek → Numbervar useVerboseFormat → BooleanFormatter.Date.Stylevar Full → Formatter.Date.Style read-onlyUse the user’s “full” format as selected in system settings.
var Long → Formatter.Date.Style read-onlyUse the user’s “long” format as selected in system settings.
var Medium → Formatter.Date.Style read-onlyUse the user’s “medium” format as selected in system settings.
var Short → Formatter.Date.Style read-onlyUse the user’s “short” format as selected in system settings.
var all → Array of Formatter.Date.Style read-onlyFunctionThe built-in JavaScript Function constructor.
GraphicAn individual graphic element on a canvas. Graphic is an abstract superclass (that is, no actual Graphic objects exist, only more specialized sub-types of Graphic such as Line and Shape).
function orderAbove(graphic: Graphic)Reorder this graphic so that it is just above the given one.
function orderBelow(graphic: Graphic)Reorder this graphic so that it is just below the given one.
function remove()Remove this graphic from its canvas, deleting it.
function setUserData(key: String, value: String or null)Set the user data string attached to this graphic for a given key.
function duplicateTo(location: Point, canvas: Canvas or null) → Graphic or nullA convenience method, this does the same thing as canvas.duplicate() and then setting the geometry origin of the newly duplicated graphic. The destination canvas parameter can be omitted entirely in order to make a duplicate of the graphic to a different location of the same canvas it is already on.
function duplicateReferenceTo(location: Point, canvas: Canvas or null) → Graphic or nullSimilar to duplicateTo(), but the newly created graphic will be a reference to this one, instead of a standalone copy.
var actionURL → URL or nullURL to be opened when this graphic is clicked/tapped with the action tool or in presentation mode.
var alignsEdgesToGrid → BooleanAlign edges or center to the grid.
var allowsConnections → BooleanAllow line connections to this graphic.
var automationAction → Array of StringAn array of two strings, the first being the plugin id and the second being the action id for an automation action. This automation action is performed when this graphic is clicked/tapped with the action tool or in presentation mode.
var connectedLines → Array of Line read-onlyAn array of all Line graphics connected to this graphic.
var cornerRadius → NumberCorner radius of the stroke.
var flippedHorizontally → BooleanIs this graphic flipped horizontally?
var flippedVertically → BooleanIs this graphic flipped vertically?
var geometry → RectThe bounds rectangle of this graphic.
var id → Number read-onlyA unique identifier (within this canvas) of this graphic. Note that this value is NOT persistent across closing/reopening of the document.
var incomingLines → Array of Line read-onlyA subset of the connected lines: those lines whose head are connected to this graphic.
var layer → Layer or nullThe layer this graphic is on.
var locked → BooleanWhether this graphic is locked.
var name → String or nullThe name of this graphic, if any. Note that most graphics do not have names unless they are explicitly set; instead they will be displayed using a placeholder string (such as “Rectangle”) in the outline.
var notes → StringNotes attached to this graphic.
var outgoingLines → Array of Line read-onlyA subset of the connected lines: those lines whose tail are connected to this graphic.
var plasticCurve → Number or nullIf the stroke style is plastic, this is the depth of curvature.
var plasticHighlightAngle → Number or nullIf the stroke style is plastic, this is the highlight angle of the “light” shining on the plastic.
var referenceGraphic → Graphic or null read-onlyThe graphic that this one is a reference of.
var referenceInstances → Array of Graphic read-onlyAn array of all graphics that are references to this graphic.
var rotation → NumberRotation of this graphic.
var shadowColor → Color or nullColor of the shadow.
var shadowFuzziness → NumberFuzziness of the shadow.
var shadowVector → PointDirection and length of the shadow.
var strokeCap → LineCapType of end cap on the stroke.
var strokeColor → Color or nullColor of the stroke.
var strokeJoin → LineJoinType of join on segments of the stroke.
var strokePattern → StrokeDashDash pattern of the stroke.
var strokeThickness → NumberThickness of the stroke in points.
var strokeType → StrokeType or nullType of stroke (the outline around the graphic).
var userData → ObjectUser data for this graphic
Group : GraphicA set of grouped graphics represented by a single graphic. Groups can contain more groups, et cetera.
new Group(graphics: Array of Graphic) → GroupConstruct a new group containing the given graphics and replace those graphics on their original canvas with the group graphic.
function ungroup() → Array of GraphicRemove this group, putting all of the graphics inside back on the canvas the group was previously upon. The group itself is deleted.
var connectToGroupOnly → BooleanWhether lines may connect to individual constituents or must connect to the group as a whole.
var graphics → Array of Graphic read-onlyAn array of graphics contained inside the group.
var magnets → Array of PointConnection magnets on the group.
Subgraph : GroupA ‘Subgraph’ is a type of ‘Group’ that can be expanded and collapsed to show or hide its contents.
new Subgraph(graphics: Array of Graphic) → Groupvar background → Solid read-onlyThe background graphic which is shown behind the contents when expanded, and by itself when collapsed.
var collapsed → BooleanWhether this subgraph is currently collapsed.
var subgraphics → Array of Graphic read-onlyAn array of graphics contained inside the subgraph.
Table : GroupA ‘Table’ is a type of ‘Group’ where the graphics inside aren’t arranged arbitrarily, but are instead in fixed rows and columns.
function withRowsColumns(rows: Number, columns: Number, graphics: Array of Graphic) → Tablenew Table(graphic: Graphic) → Tablefunction graphicAt(row: Number, column: Number) → Graphic or nullRetrieve the contained graphic at the given row and column index.
function setRowHeight(pts: Number, ofRow: Number)Change the height of all graphics in the given row index so that the row itself is the new height.
function setColumnWidth(pts: Number, ofColumn: Number)Change the width of all graphics in the given column index so that the column itself is the new width.
var columns → NumberNumber of columns in the table.
var rows → NumberNumber of rows in the table.
Line : GraphicA graphic which is a line, potentially connecting two other graphics at its head and tail ends.
var allLineEndingTypes → Array of String read-onlyvar bezierPoints → Array of PointArray of bezier control points, or empty for non-bezier lines. Each line point is first, followed by its control points. The first and last line point have a single control point, while any intermediate line points have two control points.
var head → Graphic or nullGraphic attached to the head of this line.
var headMagnet → NumberIndex of the magnet in the head graphic which this line is connected to. Zero if not any particular magnet.
var headScale → NumberScale of the line ending at the head end of this line.
var headType → StringType of line ending at the head end of this line.
var hopType → HopTypeStyle and behavior of line hops when this line passes over any other line on this canvas.
var lineLength → Number read-onlyThe overall length of this line. The value you’d get from using the Line Length text tag in a label for this line.
var lineType → LineTypeLine type of this line. (Straight, Curved, Orthogonal, Bezier.)
var points → Array of PointArray of control points for this line in canvas coordinates.
var tail → Graphic or nullGraphic attached to the tail of this line.
var tailMagnet → NumberIndex of the magnet in the tail graphic which this line is connected to. Zero if not any particular magnet.
var tailScale → NumberScale of the line ending at the tail end of this line.
var tailType → StringType of line ending at the tail end of this line.
Solid : GraphicA solid graphic is one that potentially has a fill, image, and text - as opposed to a ‘Line’, which has only a stroke. Almost all solid graphics will actually be the subclass ‘Shape’, but a canvas background is a ‘Solid’ without being a ‘Shape’.
var autosizing → TextAutosizingAutosizing behavior of the graphic when the text size changes.
var fillColor → Color or nullColor of the fill for this graphic.
var fillType → FillType or nullStyle of fill for this graphic.
var fontName → StringFont of text in this graphic. This is the Font’s “Postscript name”, as displayed in the Font Book application’s Font Info pane on the Mac. Where there are multiple fonts, this returns the first character’s font. Setting this value sets it for all text in the graphic.
var gradientAngle → NumberFor linear gradients, the angle at which the gradient is drawn.
var image → ImageReference or nullImage fill for this graphic, if any.
var imageOffset → PointPositioning offset of the image fill. This is the difference between the image origin and the graphic origin in percentage terms.
var imageOpacity → NumberOpacity percentage for the image fill for this graphic.
var imagePage → NumberPage number to display for the given image, if relevant. Mainly useful for PDF images, which are potentially multiple pages.
var imageScale → SizeScaling of the image fill. This is a multiplier between the displayed size and original image size.
var imageSizing → ImageSizingType of sizing behavior for the image, if any.
var magnets → Array of PointArray of connection magnets for this graphic.
var text → StringText contents of this graphic.
var textAlongPathGlyphAnchor → Numbertext-on-path glyph placement anchor; 0 = glyph anchored at bottom center (this is how text-on-path works in OmniGraffle 7.10 and later), 1 = glyph anchored at bottom left (this is how text-on-path works in OmniGraffle 7.9.3 and previous)
var textColor → ColorColor of the text in this graphic. Where there are multiple colors, this returns the first character’s color. Setting this value sets it for all text in the graphic.
var textFlow → TextFlowText flow behavior of the graphic.
var textGeometry → Rect read-onlyDrawing bounds of the text in canvas coordinates.
var textHorizontalAlignment → HorizontalTextAlignmentAlignment of the text in this graphic horizontally.
var textHorizontalPadding → NumberHorizontal padding between the edge of the graphic’s bounds and the edge of the text area where text is drawn.
var textRotation → NumberRotation of the text.
var textRotationIsRelative → BooleanWhether the text rotation is relative to the existing rotation of the graphic itself, or whether it is constant compared to the canvas.
var textSize → NumberFont size of text in this graphic. Where there are multiple fonts, this returns the first character’s font size. Setting this value sets it for all text in the graphic.
var textUnitRect → RectSize and position of the graphics’ text area as a unit square. I.e. The x and y are in terms of proportion of graphic size from the graphic bounds (so 0,0 is the graphic origin, (1,1) originates at the graphic’s lower-righthand corner, and the width and height are the scale of the text area in proportion to the graphic, so (1,1) is the same size as the graphic bounds, (2,2) would be twice as large, etc.
var textVerticalPadding → NumberVertical padding between the edge of the graphic’s bounds and the edge of the text area where text is drawn.
var textVerticalPlacement → VerticalTextPlacementAlignment of the text in this graphic vertically.
var textWraps → BooleanWhether the text wraps to the graphic’s bounds, or can go as wide as it wishes outside the graphic bounds.
Shape : SolidA ‘Solid’ graphic which has a particular shape, either one of the built-in shapes, or a custom bezier shape.
var shape → String or nullName of the shape for this graphic.
var shapeControlPoints → Array of PointThe vertices and controlPoint1 & controlPoint2 of each bezier segment. For straight line segments, both control points will be identical to the vertex point.
var shapeVertices → Array of PointArray of vertices for this shape.
GraphicViewThe view of the canvas in an OmniGraffle window.
function select(graphics: Array of Graphic, extending: Boolean or null)Change the selection to a new array of graphics. If extending is true, then the previous selection is retained as well.
function deselect(graphics: Array of Graphic)Removes any of the passed graphics from the current selection, leaving any other currently selected graphics still selected.
function edit(solid: Solid)Begin editing the text of a solid graphic.
var canvas → CanvasThe canvas currently being displayed in this view.
var visibleRect → RectThe rectangle of the canvas which is visible in the window.
GridHolds the grid settings for a particular canvas.
var drawsInFront → BooleanWhether the grid draws in front of all graphics or behind them.
var majorColor → ColorColor of the major grid lines.
var majorSpacing → NumberNumber of minor grid squares between each major grid line.
var minorColor → ColorColor of the minor grid lines.
var snaps → BooleanWhether graphics on the canvas snap to the grid.
var spacing → NumberNumber of points of spacing between each minor grid line. (Also the width and height of each minor grid square.)
var visible → BooleanWhether the grid is currently visible or invisible.
HierarchicalDirectionvar Bottom → HierarchicalDirection read-onlyRoot of the hierarchy is at the bottom and tree extends upwards.
var Left → HierarchicalDirection read-onlyRoot of the hierarchy is at the left and tree extends rightwards.
var Right → HierarchicalDirection read-onlyRoot of the hierarchy is at the right and tree extends leftwards.
var Top → HierarchicalDirection read-onlyRoot of the hierarchy is at the top and tree extends downwards.
var all → Array of HierarchicalDirection read-onlyHopTypevar Bridge → HopType read-onlyBridge over the other line(s).
var Gap → HopType read-onlyLeave a gap while crossing the other line(s).
var Ignore → HopType read-onlyNo hops, and ignore this line when computing hops for other lines.
var None → HopType read-onlyDon’t hop at all.
var Round → HopType read-onlyRounded over the other line(s).
var RoundUnder → HopType read-onlyRounded under the other line(s).
var Square → HopType read-onlySquare shape over the other line(s).
var SquareUnder → HopType read-onlySquare shape under the other line(s).
var ThreeSide → HopType read-onlyThree segments angled over the other line(s).
var ThreeSideUnder → HopType read-onlyThree segments angled under the other line(s).
var TwoSide → HopType read-onlyVee over the other line(s).
var TwoSideUnder → HopType read-onlyVee under the other line(s).
var all → Array of HopType read-onlyHorizontalAlignmentvar Center → HorizontalAlignment read-onlyAlign to horizontal centers.
var Left → HorizontalAlignment read-onlyAlign to left edges.
var Right → HorizontalAlignment read-onlyAlign to right edges.
var all → Array of HorizontalAlignment read-onlyHorizontalTextAlignmentvar Center → HorizontalTextAlignment read-onlyCentered horizontally.
var Justify → HorizontalTextAlignment read-onlySpacing adjusted to fill available horizontal space.
var Left → HorizontalTextAlignment read-onlyAligned left.
var Right → HorizontalTextAlignment read-onlyAligned right.
var all → Array of HorizontalTextAlignment read-onlyImagefunction symbolNamed(name: String) → Image or nullReturns an image given a symbol name.
ImageReferenceAn image inside an OmniGraffle document. The image can be part of the fill for more than one ‘Solid’ graphic, and all of them will refer to the same ‘ImageReference’.
var data → Data or null read-onlyThe image data bytes.
var originalSize → Size read-onlyOriginal size of the image in pixels.
var uniqueID → Number read-onlyA unique (within this document) identifier for this image reference.
ImageSizingvar Manual → ImageSizing read-onlyManual.
var Stretched → ImageSizing read-onlyStretched.
var Tiled → ImageSizing read-onlyTiled.
var all → Array of ImageSizing read-onlyLayerA layer containing graphics on a given canvas.
function orderAbove(layer: Layer)Reorder this layer so that it is just above the given layer.
function orderBelow(layer: Layer)Reorder this layer so that it is just below the given layer.
function remove()Remove this layer from its canvas, deleting it.
function addShape(shapeName: String, bounds: Rect) → ShapeCreate a new graphic of a given shape and place it on this layer.
function newShape() → ShapeCreate a zero-sized rectangle (presumably to be modified further) and place it on this layer.
var graphics → Array of Graphic read-onlyAll graphics in this layer.
var locked → BooleanWhether this layer is locked, effectively locking all graphics contained in the layer.
var name → StringName of this layer.
var prints → BooleanWhether graphics on this layer should be visible when this canvas is printed.
var visible → BooleanWhether graphics on this layer are visible.
LayoutGraphic layout information for a canvas.
var automaticLayout → BooleanWhether to re-layout automatically on every change to the canvas.
var circularLineLength → NumberOptimum line length to try to achieve during circular layout.
var direction → HierarchicalDirectionThe hierarchical layout orientation.
var forceDirectedLineLength → NumberOptimum line length to try to achieve during force-directed layout.
var forceDirectedSeparation → NumberSeparation distance between graphics to try to achieve during force-directed layout.
var objectSeparation → NumberDistance between graphics at the same level during hierarchical layout.
var radialSeparation → NumberDistance between graphics during radial layout.
var rankSeparation → NumberDistance between graphics from one level to an adjacent level higher or lower during hierarchical layout.
var type → LayoutTypeType of layout to perform: hierarchical, circular, radial, or force-directed.
LayoutTypevar Circular → LayoutType read-onlyTries to arrange sibling shapes in a circle around their parent.
var ForceDirected → LayoutType read-onlyGrows in semi-random directions from the center.
var Hierarchical → LayoutType read-onlyCreates layers of equally-ranked objects, extending in one direction..
var Radial → LayoutType read-onlyTries to arrange sibling shapes in arcs around their parent.
var all → Array of LayoutType read-onlyLineCapvar Butt → LineCap read-onlyThe line has a flat end cap, exactly at the end point of the line.
var Round → LineCap read-onlyThe line has a round end cap, with the center at the end point of the line, and radius of half its width.
var Square → LineCap read-onlyThe line has a flat end cap, extending half the line width past the end point.
var all → Array of LineCap read-onlyLineJoinvar Bevel → LineJoin read-onlyLine segments are joined with a squared-off end.
var Miter → LineJoin read-onlyLine segments are joined with a sharp (angled) corner.
var Round → LineJoin read-onlyLine segments are joined with a rounded end.
var all → Array of LineJoin read-onlyLineTypevar Bezier → LineType read-onlyBezier line.
var Curved → LineType read-onlyCurved line.
var Orthogonal → LineType read-onlyOrthogonal line.
var Straight → LineType read-onlyStraight line.
var all → Array of LineType read-onlyLocalevar identifiers → Array of String read-onlyThe list of known ISO locale identifiers.
new Locale(identifier: String) → Localevar calendar → Calendar read-onlyThe calendar for the locale.
var currencyCode → String or null read-onlyThe currency code for the locale.
var identifier → String read-onlyThe ISO locale identifier for this object.
MenuItemvar checked → BooleanIf true, a checkmark is displayed next to the MenuItem’s label.
var image → Image or nullAn optional image to be displayed with the MenuItem.
var label → StringThe string displayed to describe the MenuItem’s action.
NSWindowfunction close()function setViewForCanvas(canvas: Canvas, zoom: Number, center: Point)Change the saved position for a canvas, so that this will be the view position and scale shown when that canvas is next selected.
var centerVisiblePoint → Pointvar selection → Selection read-onlyvar zoom → NumberNotificationnew Notification(title: String) → Notificationfunction show() → Promise of NotificationAttempts to present the notification and returns a Promise which will yield the notification object itself if it is clicked or tapped, or an error if it cannot be presented or is dismissed.
var subtitle → String or nullvar title → StringOGOutlineNodeAn outline node is one element of a hierarchical organization of the canvas’s graphics. Each node represents a single shape, with the lines between shapes determining parent-child relationships. The outline structure is visualized in the Mac applications ‘Outline’ sidebar tab.
var children → Array of OGOutlineNode read-onlyChild nodes of this node.
var graphic → Graphic or null read-onlyGraphic that this outline node represents.
PasteboardA pasteboard temporarily holds representations of items of different types for transfer between different applications or different locations in the application.
function makeUnique() → PasteboardCreates a new unique pasteboard.
var general → Pasteboard read-onlyThe Pasteboard used for user-initiated copy/paste support.
function availableType(types: Array of TypeIdentifier) → TypeIdentifier or nullThe first type from the provided list which is available on the pasteboard, or null if none are available.
function addItems(items: Array of Pasteboard.Item)Appends the new items to the pasteboard.
function clear()Remove all items from the pasteboard.
function dataForType(type: TypeIdentifier) → Data or nullThe Data representation for the given type in this pasteboard, or null if none is available.
function setDataForType(data: Data, type: TypeIdentifier)Set the Data representation for the given type in this pasteboard, replacing any previously set data.
function stringForType(type: TypeIdentifier) → String or nullThe String representation for the given type in this pasteboard, or null if none is available.
function setStringForType(string: String, type: TypeIdentifier)Set the String representation for the given type in this pasteboard, replacing any previously set data.
var URL → URL or nullGets or sets the pasteboard content as a single URL.
var URLs → Array of URL or nullGets or sets the pasteboard content as a list of URLs.
var color → Color or nullGets or sets the pasteboard content as a single color.
var colors → Array of Color or nullGets or sets the pasteboard content as a list of colors.
var hasColors → Boolean read-onlyReturns true if the pasteboard contains one or more colors.
var hasImages → Boolean read-onlyReturns true if the pasteboard contains one or more images.
var hasStrings → Boolean read-onlyReturns true if the pasteboard contains one or more strings.
var hasURLs → Boolean read-onlyReturns true if the pasteboard contains one or more URLs.
var image → Image or nullGets or sets the pasteboard content as a single image.
var images → Array of Image or nullGets or sets the pasteboard content as a list of images.
var items → Array of Pasteboard.ItemThe array of individual items on the pasteboard, each potentially with their own set of types.
var string → String or nullGets or sets the pasteboard content as a single plain-text string.
var strings → Array of String or nullGets or sets the pasteboard content as a list of plain-text strings.
var types → Array of TypeIdentifier read-onlyThe list of pasteboard types currently available on the pasteboard.
Pasteboard.Itemnew Pasteboard.Item() → Pasteboard.ItemMake a new empty pasteboard item with no contents.
function dataForType(type: TypeIdentifier) → Data or nullThe Data representation for the given type in this pasteboard item, or null if none is available.
function setDataForType(data: Data, type: TypeIdentifier)Set the Data representation for the given type in this pasteboard item, replacing any previously set data.
function stringForType(type: TypeIdentifier) → String or nullThe String representation for the given type in this pasteboard item, or null if none is available.
function setStringForType(string: String, type: TypeIdentifier)Set the String representation for the given type in this pasteboard item, replacing any previously set data.
var types → Array of TypeIdentifier read-onlyThe list of types available for this pasteboard item.
PlugInfunction find(identifier: String, minimumVersion: Version or null) → PlugIn or nullvar all → Array of PlugIn read-onlyfunction library(identifier: String) → PlugIn.Library or nullLooks for a PlugIn.Library in the receiver and returns it if found.
function action(identifier: String) → PlugIn.Action or nullfunction handler(identifier: String) → PlugIn.Handler or nullfunction resourceNamed(name: String) → URL or nullfunction imageNamed(name: String) → Image or nullfunction localizedResourceNamed(filename: String) → FileWrapper or nullvar URL → URL or null read-onlyReturns the original URL from whence this PlugIn came, if known.
var actions → Array of PlugIn.Action read-onlyvar author → String read-onlyReturns the author for the PlugIn.
var description → String read-onlyReturns the description provided for the PlugIn.
var displayName → String read-onlyReturns the localized, human-readable name for the PlugIn.
var handlers → Array of PlugIn.Handler read-onlyvar identifier → String read-onlyThe unique identifier of the PlugIn.
var libraries → Array of PlugIn.Library read-onlyvar version → Version read-onlyReturns the current Version for the PlugIn.
PlugIn.Actionnew PlugIn.Action(perform: Function) → PlugIn.ActionReturns a new PlugIn.Action. Only used within an action JavaScript file embedded within a PlugIn.
var description → String read-onlyvar label → String read-onlyReturns the default label to use for interface controls that invoke the action.
var longLabel → String read-onlyReturns the label to use for interface controls that invoke the action, when a long amount of space is available.
var mediumLabel → String read-onlyReturns the label to use for interface controls that invoke the action, when a medium amount of space is available.
var name → String read-onlyReturns the name of the PlugIn.Action.
var paletteLabel → String read-onlyReturns the label to use for interface controls that show a prototype of the action control, such as on a macOS toolbar configuration sheet.
var perform → Function read-onlyvar plugIn → PlugIn read-onlyReturns the PlugIn that contains this object.
var shortLabel → String read-onlyReturns the label to use for interface controls that invoke the action, when a short amount of space is available.
var validate → Function or nullA 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.Handlernew PlugIn.Handler(invoke: Function) → PlugIn.HandlerReturns a new PlugIn.Handler. Only used within an handler JavaScript file embedded within a PlugIn.
var invoke → Function read-onlyThe Function that will be executed for each handler registered for an event posted by an application object.
var name → String read-onlyReturns the name of the PlugIn.Handler.
var plugIn → PlugIn read-onlyReturns the PlugIn that contains this object.
var willAttach → Function or nullAn 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 willDetach → Function or nullAn 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.Handler.Registrationfunction remove()Removes a previously added event observation.
PlugIn.LibraryAn object that represents a library from a plug-in.
new PlugIn.Library(version: Version) → PlugIn.LibraryReturns a new Library. Typically only used within a library JavaScript file embedded within a PlugIn.
var name → String read-onlyReturns the name of the PlugIn.Library.
var plugIn → PlugIn read-onlyReturns the PlugIn that contains this object.
var version → Version read-onlyReturns the Version of this library, as passed to the constructor.
Pointvar unitX → Point read-onlyReturns a Point with coordinates (1, 0).
var unitY → Point read-onlyReturns a Point with coordinates (0, 1).
var zero → Point read-onlyReturns the Point (0, 0), the origin.
new Point(x: Number, y: Number) → PointReturns a new Point with the specified coordinates.
function add(point: Point) → PointReturns a new Point that is the component-wise sum of the receiver and the argument Point.
function subtract(point: Point) → PointReturns a new Point that is the component-wise difference of the receiver and the argument Point.
function scale(factor: Number) → PointReturns a new Point where each component is scaled by the given factor.
function distanceTo(point: Point) → NumberReturns the distance between the receiver and the given Point.
function dot(point: Point) → NumberReturns the dot product between the receiver and the given Point.
var length → Number read-onlyReturns the distance between the receiver and the origin.
var negative → Point read-onlyReturns the component-wise negative of the receiver.
var normalized → Point read-onlyFor a non-zero point, returns a point with a distance of one from the origin, but in the same direction as the original. For the zero point, this returns the receiver.
var x → NumberThe horizontal axis coordinate of the Point.
var y → NumberThe vertical axis coordinate of the Point.
Portfoliofunction addCanvas() → Canvas or nullAdd a new canvas to the end of the current canvases.
function addImage(data: Data) → ImageReference or nullAdd an image to the document given some image data. The resulting ImageReference can then be set as the image fill of any number of Solid graphics on canvases within this document. Returns nil if the data could not be interpreted as a valid image.
function copyImage(image: ImageReference) → ImageReference or nullCopy an image from another document or stencil to this one.
var app → Application read-onlyReturns the shared Application.
var canvases → Array of Canvas read-onlyList of canvases in the portfolio.
var console → Console read-onlyReturns the shared Console.
var document → GraffleDocument or null read-onlyvar images → Array of ImageReference read-onlyA list of all images referenced by any graphic in this document. Each ImageReference is a unique image and appears only once in the list, even if it is used as the image fill for multiple graphics.
Preferencesnew Preferences(identifier: String or null) → PreferencesCreates a new Preferences instance. The identifier specified may be null to create an instance for the currently loading plug-in. If it is null and a plug-in is not being loaded, an error will be thrown. Key/value pairs stored in the instance will be prefixed with the identifier and a “.”.
function read(key: String) → Object or nullReturns the previously stored value for the given key, or null if no value is stored.
function readBoolean(key: String) → BooleanReturns the previously stored value as a Boolean, or false if there is no stored value or it can’t be converted to a Boolean.
function readString(key: String) → String or nullReturns the previously stored value as a String, or null if there is no stored value or it is not a String.
function readNumber(key: String) → NumberReturns the previously stored value as a Number, or null if there is no stored value or it is not a Number.
function readDate(key: String) → Date or nullReturns the previously stored value as a Date, or null if there is no stored value or it is not a Date.
function readData(key: String) → Data or nullReturns the previously stored value as a Data, or null if there is no stored value or it is not a Data.
function write(key: String, value: Boolean, String, Number, Date, or Data or null)Stores the specified key/value pair, or removes the pair if value is null.
function remove(key: String)Removes and previously stored value for the given key.
var identifier → String read-onlyThe scoping identifier the instance given when created, or the plug-in identifier if none was given.
PromiseThe built-in JavaScript Promise constructor.
Rectnew Rect(x: Number, y: Number, width: Number, height: Number) → RectReturns a new Rect with the specified coordinates and size.
function insetBy(dx: Number, dy: Number) → Rectfunction offsetBy(dx: Number, dy: Number) → Rectfunction union(rect: Rect) → Rectfunction intersect(rect: Rect) → Rectfunction containsRect(rect: Rect) → Booleanfunction containsPoint(point: Point) → Booleanfunction intersects(rect: Rect) → Booleanvar center → Point read-onlyvar height → Numbervar integral → Rect read-onlyvar isEmpty → Boolean read-onlyvar isInfinite → Boolean read-onlyvar isNull → Boolean read-onlyvar maxX → Number read-onlyvar maxY → Number read-onlyvar midX → Number read-onlyvar midY → Number read-onlyvar minX → Number read-onlyvar minY → Number read-onlyvar origin → Pointvar size → Sizevar standardized → Rect read-onlyvar width → Numbervar x → Numbervar y → NumberSelectionThe ‘selection’ argument to plugin actions, letting them inspect the selection.
var canvas → Canvas or null read-onlyThe currently selected canvas.
var document → GraffleDocument or null read-onlyThe current document whose graphics are selected.
var graphics → Array of Graphic read-onlyThe currently selected graphics.
var lines → Array of Line read-onlyThe subset of the currently selected graphics which are lines.
var solids → Array of Solid read-onlyThe subset of the currently selected graphics which are solids.
var view → GraphicView or null read-onlyThe current view containing the selection.
ShapeCombinationvar Intersect → ShapeCombination read-onlyForm the intersection of the shapes.
var None → ShapeCombination read-onlyPerform no combination operation.
var Subtract → ShapeCombination read-onlySubtract the shapes from the first shape
var Union → ShapeCombination read-onlyForm the union of the shapes.
var Unite → ShapeCombination read-onlyAn alias for Union.
var all → Array of ShapeCombination read-onlySharePanelAn interface that can display the system share interaction for the given items.
new SharePanel(items: Array of URL, String, Image, or FileWrapper) → SharePanelCreate a new share panel with the given items.
function addItem(shareItem: URL, String, Image, or FileWrapper)Appends the item to the end of items.
function addItems(shareItems: Array of URL, String, Image, or FileWrapper)Appends the contents of the given array to the end of items.
function removeItem(shareItem: URL, String, Image, or FileWrapper)Removes the first occurrence of the item from items if it is present in items.
function removeItems(shareItems: Array of URL, String, Image, or FileWrapper)Removes the first occurrence of each member of the given array from items if that member is present in items.
function clearItems()Sets items to an empty array. Note: Calling show when items is empty results in an error, so be sure to add new items after calling this and before calling show.
function show()Presents the share panel for its items. Calling this when items is empty will result in an error.
var items → Array of URL, String, Image, or FileWrapperThe items that will be supplied to the system share interaction upon calling show.
Sizenew Size(width: Number, height: Number) → SizeReturns a new Size with the specified width and height.
var height → Numbervar width → NumberSpeechSpeech.Boundaryvar Immediate → Speech.Boundary read-onlyvar Word → Speech.Boundary read-onlyvar all → Array of Speech.Boundary read-onlySpeech.Synthesizernew Speech.Synthesizer() → Speech.Synthesizerfunction speakUtterance(utterance: Speech.Utterance)Enqueues the utterance. If the utterance is already or enqueued or speaking, throws and error.
function stopSpeaking(boundary: Speech.Boundary) → Booleanfunction pauseSpeaking(boundary: Speech.Boundary) → Booleanfunction continueSpeaking() → Booleanvar paused → Boolean read-onlyvar speaking → Boolean read-onlySpeech.Utterancevar defaultSpeechRate → Number read-onlyvar maximumSpeechRate → Number read-onlyvar minimumSpeechRate → Number read-onlynew Speech.Utterance(string: String) → Speech.Utterancevar pitchMultiplier → NumberA value between 0.5 and 2.0, controlling the picth of the utterance.
var postUtteranceDelay → Numbervar preUtteranceDelay → Numbervar prefersAssistiveTechnologySettings → BooleanIf an assistive technology is on, like VoiceOver, the user’s selected voice, rate and other settings will be used for this speech utterance instead of the default values. If no assistive technologies are on, then the values of the properties on AVSpeechUtterance will be used. Note that querying the properties will not refect the user’s settings.
var rate → NumberA value between Speech.Utterance.minimumSpeechRate and Speech.Utterance.maximumSpeechRate controlling the rate of speech for the utterance.
var string → String or null read-onlyvar voice → Speech.Voice or nullThe voice to use for this utterance, or null in which case the default voice will be used.
var volume → NumberA value between 0.0 and 1.0 controller the volume of the utterance.
Speech.Voicefunction withLanguage(code: String or null) → Speech.Voice or nullReturns a voice for the given BCP–47 language code (such as en-US or fr-CA), or the default voice if passed null. Returns null for an invalid langauge code.
function withIdentifier(identifier: String) → Speech.Voice or nullReturns the voice with the given identifier, or null if not found.
var allVoices → Array of Speech.Voice read-onlyvar currentLanguageCode → String read-onlyvar gender → Speech.Voice.Gender read-onlyvar identifier → String read-onlyvar language → String read-onlyvar name → String read-onlySpeech.Voice.Gendervar Female → Speech.Voice.Gender read-onlyvar Male → Speech.Voice.Gender read-onlyvar Unspecified → Speech.Voice.Gender read-onlyvar all → Array of Speech.Voice.Gender read-onlyStencilA stencil containing graphics that can be copied to documents.
function load(completed: Function(stencil: Stencil))Load this stencil document into memory so its graphics and images can be accessed.
var graphics → Array of Graphic read-onlyArray of graphics available on the stencil.
var images → Array of ImageReference read-onlyA list of all images referenced by any graphic in this stencil. Each ImageReference is a unique image and appears only once in the list, even if it is used as the image fill for multiple graphics.
var isLoaded → Boolean read-onlyWhether or not this stencil has already been loaded into memory.
var name → String read-onlyName of the stencil.
StringEncodingvar ASCII → StringEncoding read-onlyvar ISO2022JP → StringEncoding read-onlyvar ISOLatin1 → StringEncoding read-onlyvar ISOLatin2 → StringEncoding read-onlyvar JapaneseEUC → StringEncoding read-onlyvar MacOSRoman → StringEncoding read-onlyvar NextStep → StringEncoding read-onlyvar NonLossyASCII → StringEncoding read-onlyvar ShiftJIS → StringEncoding read-onlyvar Symbol → StringEncoding read-onlyvar UTF16 → StringEncoding read-onlyvar UTF16BigEndian → StringEncoding read-onlyvar UTF16LittleEndian → StringEncoding read-onlyvar UTF32 → StringEncoding read-onlyvar UTF32BigEndian → StringEncoding read-onlyvar UTF32LittleEndian → StringEncoding read-onlyvar UTF8 → StringEncoding read-onlyvar Unicode → StringEncoding read-onlyvar WindowsCP1250 → StringEncoding read-onlyvar WindowsCP1251 → StringEncoding read-onlyvar WindowsCP1252 → StringEncoding read-onlyvar WindowsCP1253 → StringEncoding read-onlyvar WindowsCP1254 → StringEncoding read-onlyvar all → Array of StringEncoding read-onlyStrokeDashvar Dash10on3off2on3off → StrokeDash read-onlyvar Dash10on3off2on3off2on3off → StrokeDash read-onlyvar Dash16on9off → StrokeDash read-onlySixteen point dash segments with nine point gaps.
var Dash16on9off16on9off1on9off → StrokeDash read-onlyvar Dash16on9off1on9off → StrokeDash read-onlyvar Dash16on9off1on9off1on9off → StrokeDash read-onlyvar Dash1on3off → StrokeDash read-onlyOne point dot segments with three point gaps.
var Dash1on4off → StrokeDash read-onlyOne point dot segments with four point gaps.
var Dash1on5off → StrokeDash read-onlyOne point dot segments with five point gaps.
var Dash1on9off → StrokeDash read-onlyOne point dot segments with nine point gaps.
var Dash20on5off4on5off → StrokeDash read-onlyvar Dash20on5off4on5off4on5off → StrokeDash read-onlyvar Dash2on2off → StrokeDash read-onlyvar Dash40on9off8on9off → StrokeDash read-onlyvar Dash40on9off8on9off8on9off → StrokeDash read-onlyvar Dash4on3off1on3off → StrokeDash read-onlyvar Dash4on3off1on3off1on3off → StrokeDash read-onlyvar Dash4on3off4on3off1on3off → StrokeDash read-onlyvar Dash4on4off → StrokeDash read-onlyFour point dash segments with four point gaps.
var Dash4on9off1on5off → StrokeDash read-onlyFour point dash alternating with one point dots, with nine and five point gaps
var Dash4on9off1on5off1on5off → StrokeDash read-onlyvar Dash8on4off1on4off → StrokeDash read-onlyEight point dash alternating with one point dots, both with four point gaps.
var Dash8on5off → StrokeDash read-onlyEight point dash with five point gaps.
var Dash8on5off8on5off1on5off → StrokeDash read-onlyvar Solid → StrokeDash read-onlySolid stroke with no dash pattern.
var all → Array of StrokeDash read-onlyStrokeTypevar Double → StrokeType read-onlyDouble.
var Freehand → StrokeType read-onlyFreehand.
var Inner → StrokeType read-onlyInner.
var Outer → StrokeType read-onlyOuter.
var Plastic → StrokeType read-onlyPlastic.
var Single → StrokeType read-onlySingle.
var all → Array of StrokeType read-onlyTextAutosizingvar Clip → TextAutosizing read-onlyClip.
var Full → TextAutosizing read-onlyFull.
var Overflow → TextAutosizing read-onlyOverflow.
var Vertical → TextAutosizing read-onlyVertical.
var all → Array of TextAutosizing read-onlyTextFlowvar Clip → TextFlow read-onlyClip.
var FillsShape → TextFlow read-onlyFills shape.
var FollowsPath → TextFlow read-onlyFollows path.
var Overflow → TextFlow read-onlyOverflow.
var Resize → TextFlow read-onlyResize.
var all → Array of TextFlow read-onlyTimeZonevar abbreviations → Array of String read-onlyThe list of known time zone abbreviations.
new TimeZone(abbreviation: String) → TimeZone or nullMake 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.
var abbreviation → String or null read-onlyThe abbreviation for the TimeZone.
var daylightSavingTime → Boolean read-onlyReturns true if the TimeZone is currently using daylight savings time.
var secondsFromGMT → Number read-onlyThe current difference in seconds between this TimeZone and GMT.
Timerfunction once(interval: Number, action: Function(timer: Timer)) → TimerMakes 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: Timer)) → TimerMakes 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.
function cancel()var interval → Number read-onlyToolbarItemvar image → Image or nullvar label → Stringvar toolTip → String or nullTypeIdentifierfunction fromPathExtension(pathExtension: String, isDirectory: Boolean) → TypeIdentifierReturn a TypeIdentifier that matches items that have the given path extension and are (or are not) directories.
var URL → TypeIdentifier read-onlyThe URL type.
var binaryPropertyList → TypeIdentifier read-onlyThe binary property list type.
var csv → TypeIdentifier read-onlyThe comma-separated text type.
var editableTypes → Array of TypeIdentifier read-onlyThe list of TypeIdentifiers that can be read and written natively by documents in this application.
var gif → TypeIdentifier read-onlyThe GIF image type.
var image → TypeIdentifier read-onlyA generic type that all image types conform to.
var jpeg → TypeIdentifier read-onlyThe JPEG image type.
var json → TypeIdentifier read-onlyThe JSON type.
var pdf → TypeIdentifier read-onlyThe PDF type.
var plainText → TypeIdentifier read-onlyThe plain text type.
var png → TypeIdentifier read-onlyThe PNG image type.
var propertyList → TypeIdentifier read-onlyThe generic property list type.
var readableTypes → Array of TypeIdentifier read-onlyThe list of TypeIdentifiers that can be read by documents in this this application.
var rtf → TypeIdentifier read-onlyThe RTF type.
var rtfd → TypeIdentifier read-onlyThe RTFD type.
var tiff → TypeIdentifier read-onlyThe TIFF image type.
var writableTypes → Array of TypeIdentifier read-onlyThe list of TypeIdentifiers that can be written by documents in this application (though some documents may be exportable only in a subset of these types).
var xmlPropertyList → TypeIdentifier read-onlyThe XML property list type.
new TypeIdentifier(identifier: String) → TypeIdentifierReturns a new TypeIdentifier with the given identifier.
function conformsTo(other: TypeIdentifier) → BooleanReturns true if the instance is the same as the given argument or a more specific type. For example, TypeIdentifier.png.conformsTo(TypeIdentifier.image) will be true, but TypeIdentifier.png.conformsTo(TypeIdentifier.plainText) will be false.
var displayName → String read-onlyReturns a human-readable description of the type.
var identifier → String read-onlyReturns a unique string for a type identifier, suitable for archiving or encoding in scripts.
var pathExtensions → Array of String read-onlyThe list of filesystem path extensions used by this type.
URLfunction choose(types: Array of String) → URL or nullDeprecated: 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 nullDeprecated: 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, relativeToURL: URL or null) → URL or nullParses the string as a URL if possible and returns a new instance, or null if the string is not a valid URL. If baseURL is not null, the result is a relative URL.
function fromPath(path: String, isDirectory: Boolean, relativeToURL: URL or null) → URLReturns a new file URL with the given path and assumption of whether it is a directory.
function tellScript(app: String, js: String, arg: Object or null) → URL or nullCreates 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 nullCreates a URL to invoke the given JS function on the given app (url scheme) appropriate for use with the call function.
var currentAppScheme → String read-onlyReturns the URL scheme for the current app.
var documentsDirectory → URL read-onlyReturns the application’s Documents directory. This is in the application’s sandbox, and on the Mac is not the user’s Documents directory. This is accessible by the application without using access().
function fetch(success: Function(contents: Data), failure: Function(error: Error) or null)Get the contents at the destination of this URL.
function call(success: Function, failure: Function or null)Invoke an x-callback-url API end-point, with the callback functions being invoked when a reply is received. When a reply is received, the parameters of that URL are decoded as JSON, or left as String values if not valid JSON, and stored as properties of a result object. For a successful reply, if the result object has one property, its value is passed as the first argument to the success function. If there are zero or more than one parameters, the full object is passed as the first argument. In both cases, the success function is passed a second argument that is the full object of parameters. The failure callback is always passed the object will all the result parameters, typically errorCode and errorMessage.
function open()Ask the system to open this URL.
function find(types: Array of TypeIdentifier, recurse: Boolean or null) → Promise of Array of URLScan a directory URL for files of the given types. If recurse is specified and is false, only the immediate contents of the directory will be considered. If recurse is not specified or is true, the full directory tree will be scanned.
function toString() → Stringfunction appendingPathComponent(component: String) → URLReturn a new URL with the given string added at the end of the path.
function appendingPathExtension(pathExtension: String) → URLReturns a new URL with the last path component having the given path extension added, including a separating “.”
function deletingPathExtension() → URLReturns a new URL with the path extension (if any) of the last path component removed.
function deletingLastPathComponent() → URLReturns a new URL with the last path component removed.
var absoluteString → String read-onlyReturns the absolute string for the URL.
var absoluteURL → URL read-onlyReturns the absolute URL.
var baseURL → URL or null read-onlyReturns the base URL if this URL is relative, or null if it is absolute.
var fragment → String or null read-onlyReturns the fragment component of the URL, or null.
var hasDirectoryPath → Boolean read-onlyReturns true if the URL’s path represents a directory.
var host → String or null read-onlyReturns the host component of the URL or null.
var isFileURL → Boolean read-onlyReturns true if the scheme is file:.
var lastPathComponent → String read-onlyReturns the last component of the URL’s path or an empty string.
var password → String or null read-onlyReturns the password component of the URL or null.
var path → String or null read-onlyReturns the path component of the URL or null.
var pathComponents → Array of String read-onlyReturns the path of the URL as an array of components.
var pathExtension → String read-onlyReturns the path extension of the last path component of the URL or the empty string.
var port → Number or null read-onlyReturns the port component of the URL or null.
var query → String or null read-onlyReturns the query component of the URL or null.
var relativePath → String or null read-onlyReturns the relative path of the URL, or the absolute path if this URL is not relative
var relativeString → String read-onlyReturns the relative portion of the URL if it is relative, otherwise this returns the absolute string.
var scheme → String or null read-onlyReturns the scheme of the URL.
var string → String read-onlyString absoluteString representation of this URL.
var user → String or null read-onlyReturns the user component of the URL or null.
URL.AccessA URL.Access holds the temporary access given by the URL.Bookmark.access() function. These should not be stored longer than needed.
var url → URL read-onlyThe URL being accessed.
URL.BookmarkA URL.Bookmark records the permission to access a given URL and will restore that permission, as well as a possibly renamed file, at a later point.
function fromURL(url: URL) → URL.BookmarkCreates a URL.Bookmark from an existing URL, which should have been returned by FilePicker. This can then be stored in a Credentials object to persistently record the permission to access this URL.
function access() → Promise of URL.AccessAttempts to resolve the instance into a URL and grant access to it through the returned Promise. Access to the URL will only last as long as the URL.Access object exists (which should not be stored longer than necessary).
URL.ComponentsURL.Components allows for correct generation and interpreation of URL instances, dealing with the specific different quoting rules for each specific part of the URL.
function fromString(string: String) → URL.Components or nullParses the string into URL.Components. If the string is not a valid URL, null is returned.
function fromURL(url: URL, resolvingAgainstBaseURL: Boolean) → URL.Components or nullParses the string represenation of the URL. If the URL’s string is malformed, null is returned. If resolve is true and the given url is relative, its base URL’s components are considered.
new URL.Components() → URL.ComponentsReturns a new URL.Components.
function urlRelativeTo(base: URL or null) → URL or nullReturns a URL relative to the base URL and the components or null.
var fragment → String or nullvar host → String or nullvar password → String or nullvar path → Stringvar port → Number or nullvar query → String or nullvar queryItems → Array of URL.QueryItem or nullThe query of the URL.Components as individual components.
var scheme → String or nullvar url → URL or null read-onlyReturns a URL for the components or null.
var user → String or nullURL.FetchRequestURL.FetchRequest represents a request for a URL resource, providing additional controls for the request (such as the HTTP method, headers, and cache controls) and uses a Promise-based API for actually performing the request and receiving a detailed response (which includes the HTTP status code and headers along with the body of the result—see URL.FetchResponse for more detail).
function fromString(string: String) → URL.FetchRequest or nullParses the string as a URL if possible and returns a new instance, or null otherwise.
new URL.FetchRequest() → URL.FetchRequestCreates a new instance.
function fetch() → Promise of URL.FetchResponsePerform the request, returning a Promise. On success, the promise will resolve to a URL.FetchResponse.
var allowsConstrainedNetworkAccess → BooleanWhether connections may use the network when the user has specified Low Data Mode.
var allowsExpensiveNetworkAccess → BooleanWhether connections may use a network interface that the system considers expensive.
var bodyData → Data or nullThe body of the request, typically used in an HTTP POST or PUT request. This API is suitable for uploading binary data, or for text which needs to be encoded in a form other than UTF–8. If UTF–8 text is suitable, bodyString is likely to be a better choice.
var bodyString → String or nullThe body of the request, typically used in an HTTP POST or PUT request. The provided string will be transmitted using the UTF–8 encoding.
var cache → String or nullThe cache policy for the request: default, no-store, reload, no-cache, force-cache, or only-if-cached.
var headers → ObjectCustom HTTP headers to be sent with this request.
var httpShouldHandleCookies → BooleanWhether to automatically handle cookies.
var httpShouldUsePipelining → BooleanWhether to transmit data before receiving a response from an earlier request.
var method → String or nullThe HTTP request method of the request: GET, POST, PUT, DELETE, etc.
var url → URL or nullThe URL for this fetch request. Much of the additional functionality provided by the fetch request API will only work with http and https URLs. (For example, the method and cache and headers don’t have any effect in the context of a file or omnifocus URL.)
URL.FetchResponseURL.FetchResponse represents the response from fetching a URL resource, providing additional information about the response such as the HTTP status code and headers along with the actual data for that response. This is a read-only object returned by performing a URL.FetchRequest; see that class for more details on actually performing the request.
var bodyData → Data or null read-onlyReturns the raw HTTP body data from this response.
var bodyString → String or null read-onlyThis is a convenience wrapper which interprets the bodyData of this response as UTF–8 text. (Note: the current implementation assumes the text is encoded using UTF–8, but ideally it would honor the text encoding as reported by textEncodingName.)
var headers → Object read-onlyReturns the HTTP header fields for this response.
var mimeType → String or null read-onlyReturns the HTTP MIME type for this response (e.g. text/plain, application/json, etc.).
var statusCode → Number read-onlyReturns the HTTP status code for this response (e.g. 200, 404, etc.).
var textEncodingName → String or null read-onlyReturns the reported text encoding for this response. This name will be the actual string reported by the origin source, or null if no encoding was specified.
var url → URL or null read-onlyReturns the URL for this response.
URL.QueryItemnew URL.QueryItem(name: String, value: String or null) → URL.QueryItemReturns a new URL.QueryItem with the given name and value.
var name → String read-onlyvar value → String or null read-onlyVersionnew Version(versionString: String) → VersionParses a string representation of a Version and returns an instance, or throws an error if the string isn’t a valid version.
function equals(version: Version) → BooleanReturns true if the receiving Version is equal to the argument Version.
function atLeast(version: Version) → BooleanReturns true if the receiving Version is at the same as or newer than the argument Version.
function isAfter(version: Version) → BooleanReturns true if the receiving Version is strictly after the argument Version.
function isBefore(version: Version) → BooleanReturns true if the receiving Version is strictly before the argument Version.
var versionString → String read-onlyReturns as an opaque string representation of the Version, suitable for display or logging. This should never be used in comparisons of any sort.
VerticalAlignmentvar Bottom → VerticalAlignment read-onlyAlign to bottom edges.
var Center → VerticalAlignment read-onlyAlign to vertical centers.
var Top → VerticalAlignment read-onlyAlign to top edges.
var all → Array of VerticalAlignment read-onlyVerticalTextPlacementvar Bottom → VerticalTextPlacement read-onlyAligned to the bottom of the shape.
var Middle → VerticalTextPlacement read-onlyCentered in the vertical middle of the shape.
var Top → VerticalTextPlacement read-onlyAligned to the top of the shape.
var all → Array of VerticalTextPlacement read-onlyXMLXML.Documentfunction fromData(data: Data, whitespaceBehavior: XML.WhitespaceBehavior or null) → XML.DocumentParse the given data as an XML document.
new XML.Document(rootElement: String or XML.Element, configuration: XML.Document.Configuration or null) → XML.DocumentReturns a new XML.Document with the given root element and configuration.
function xmlData() → DataEncodes the document as XML.
function addElement(name: String, function: Function() or null)Appends a new element with the given name. If a function is passed, it is pushed it on the current element stack, the supplied function is called, and then the element is popped off the stack.
function appendString(string: String)Appends the given string as a child of topElement.
function setAttribute(attribute: String, value: String or null)Sets the specified attribute on topElement.
var dtdPublicID → String or null read-onlyvar dtdSystemID → URL or null read-onlyvar rootElement → XML.Element read-onlyvar schemaID → URL or null read-onlyvar schemaNamespace → String or null read-onlyvar stringEncoding → StringEncoding read-onlyvar topElement → XML.Element read-onlyReturns the element at the top of the current element stack. Intially this is the root element, but when addElement() is called, it is temporarily updated to the new element (possibly recursively).
var whitespaceBehavior → XML.WhitespaceBehavior read-onlyXML.Document.Configurationnew XML.Document.Configuration() → XML.Document.ConfigurationReturns a new XML.Document.Configuration with default settings.
var dtdPublicID → String or nullvar dtdSystemID → URL or nullvar schemaID → URL or nullvar schemaNamespace → String or nullvar stringEncoding → StringEncodingvar whitespaceBehavior → XML.WhitespaceBehavior or nullXML.Elementnew XML.Element(name: String) → XML.ElementReturns a new XML.Element with the given name.
function childAtIndex(childIndex: Number) → String or XML.Element or nullReturns the child at the given index, or nil if the index is past the last child.
function insertChild(child: String or XML.Element, childIndex: Number)Inserts the new child at the specified index. If the index is past the end of the current children, it is appended instead.
function appendChild(child: String or XML.Element)Adds the new item to the end of the children.
function removeChildAtIndex(childIndex: Number)Removes the child at the given index. If the index is past the end of the current children, no removal occurs.
function removeAllChildren()Removes any existing children.
function firstChildNamed(name: String) → XML.Element or nullReturns the first child element with the given name, or null if there is no such child.
function firstChildAtPath(path: String) → XML.Element or nullGiven a path which is a string separated by "/", returns the first element at that path.
function firstChildWithAttribute(attribute: String, value: String) → XML.Element or nullReturns the first child with an attribute set to the given value.
function attributeNamed(name: String) → String or nullReturns the value of the the given attribute or null if no value has been assigned.
function setAttribute(name: String, value: String or null)Sets the value for the specified attribute. If the element already had a value for this attribute, it is replaced in place. If there previously was no value for this attribute, the attribute is appended to attributeNames. If the new value is null, the attribute is removed.
function apply(function: Function(node: String or XML.Element) → _omnijs_AnonymousProxy or null) → _omnijs_AnonymousProxy or nullCalls the supplied function for each child element or string in the receiver (including the receiver), passing that child as the single argument. The supplied function can optionally return a ApplyResult to skip enumeration of some elements.
var attributeCount → Number read-onlyReturns the number of attributes assigned to this element.
var attributeNames → Array of String read-onlyReturns the names of the attributes in the order they were added to the element.
var children → Array of String or XML.ElementThe current child strings and elements.
var childrenCount → Number read-onlyReturns the current count of child strings and elements.
var lastChild → String or XML.Element or null read-onlyReturns the last child of the element, or null if there are no children.
var name → String read-onlyReturns the name of the element.
var stringContents → String read-onlyGathers all the immediate and descendent string children and returns them concatenated them as single string.
XML.WhitespaceBehaviornew XML.WhitespaceBehavior(defaultBehavior: XML.WhitespaceBehavior.Type) → XML.WhitespaceBehaviorReturns a new XML.WhitespaceBehavior with the given default type.
function setBehaviorForElementName(behavior: XML.WhitespaceBehavior.Type, elementName: String)function behaviorForElementName(elementName: String) → XML.WhitespaceBehavior.Typevar defaultBehavior → XML.WhitespaceBehavior.Type read-onlyXML.WhitespaceBehavior.Typevar Auto → XML.WhitespaceBehavior.Type read-onlyInherit the behavior from the enclosing element
var Ignore → XML.WhitespaceBehavior.Type read-onlyIgnore whitespace
var Preserve → XML.WhitespaceBehavior.Type read-onlyPreserve whitespace
var all → Array of XML.WhitespaceBehavior.Type read-only