Alert
Application
Array
Canvas
CanvasSizingMode
Color
ColorSpace
Console
Data
Document
FileWrapper
FileWrapper.Type
FillType
Function
GraffleDocument
Graphic
GraphicView
Grid
Group
HierarchicalDirection
HopType
HorizontalAlignment
HorizontalTextAlignment
Image
ImageReference
ImageSizing
Layer
Layout
LayoutType
Line
LineCap
LineJoin
LineType
NSWindow
OGOutlineNode
Object
PlugIn
PlugIn.Action
PlugIn.Handler
PlugIn.Handler.Registration
PlugIn.Library
Point
Portfolio
Rect
Selection
Shape
Size
Solid
Stencil
StrokeDash
StrokeType
Subgraph
Table
TextAutosizing
Timer
URL
Version
VerticalAlignment
VerticalTextPlacement
Alert
An alert panel for displaying information to the user.
new Alert(title:String, text:String)
→ Alert
Create a new alert panel with the given title and text contents.
function show(callback:Function
)
Bring the alert panel forward to display it.
function addOption(string:String)
No documentation available.
Application
An object representing the OmniGraffle application itself. The type of the global variable app
.
function openDocument(from:Document
or nil, url:URL
, completed:Function
)
Attempts to open the specified document and return a reference to it asynchronously. If the document is already open, the reference is passed along. Note that due to platform sandboxing restrictions, opening the document may fail if the application doesn’t have currently permission to access the given URL
. The document, if any, that is associated with the calling script can be passed along to help grant permission to open the new document.
The passed in function will be passed two argument. The first will be either either the Document
or an Error
. On success, the second argument is a Boolean
specifying whether the document was already open.
var commandKeyDown
→ Boolean read-onlyNo documentation available.
var controlKeyDown
→ Boolean read-onlyNo documentation available.
var name
→ String read-onlyApplication name.
var optionKeyDown
→ Boolean read-onlyNo documentation available.
var platformName
→ String read-onlyNo documentation available.
var shiftKeyDown
→ Boolean read-onlyNo documentation available.
var stencils
→ Array of Stencil
read-onlyList of stencils that OmniGraffle currently has available.
var version
→ String read-onlyApplication version number.
Array
A JavaScript Array.
Canvas
No documentation available.
function 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
)
→ Shape
Create a new graphic of a given shape and place it on the first visible and unlocked layer.
function newShape()
→ Shape
Create a zero-sized rectangle (presumably to be modified further) and place it on the first visible and unlocked layer.
function newLayer()
→ Layer
Create a new (top-most) layer.
function addLine(start:Point
, end:Point
)
→ Line
Create a new line between two points and place it on the first visible layer.
function newLine()
→ Line
Create a new zero-length line (presumably to be modified further) and place it on the first visible layer.
function addText(text:String, origin:Point
)
→ Solid
Create a new shape containing text (with no stroke or shadow) and place it on the first visible layer.
function connect(from:Graphic
, to:Graphic
)
→ Line
Create a new line connecting two existing graphics.
function duplicate(graphics:Array of Graphic
)
→ Array of Graphic
Duplicate 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 nilGet the graphic with the given id, if it exists on this canvas.
function graphicWithName(name:String)
→ Graphic
or nilGet 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 Graphic
Get all graphics with the given data string for the user data key.
function graphicWithUserDataForKey(data:String, key:String)
→ Graphic
or nilGet the first graphic with the given data string for the user data key, if any.
function onGraphicChanged(handler:PlugIn.Handler
)
→ PlugIn.Handler.Registration
or nilA 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
→ BooleanNo documentation available.
var canvasSizingMode
→ CanvasSizingMode
No documentation available.
var columnAlignment
→ VerticalAlignment
Setting 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
→ HorizontalAlignment
Setting for how graphics ought to be aligned horizontally.
var size
→ Size
Overall 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.
CanvasSizingMode
No documentation available.
var 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.
Color
No documentation available.
function RGB(r:Number, g:Number, b:Number, a:Number or nil)
→ Color
Makes a new color in the RGB
colorspace, with the given components. If the alpha component is not given, 1.0 is used.
function HSB(h:Number, s:Number, b:Number, a:Number or nil)
→ Color
Makes a new color in the HSB
colorspace, with the given components. If the alpha component is not given, 1.0 is used.
function White(w:Number, a:Number or nil)
→ Color
Makes 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 nilReturns 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.
ColorSpace
No documentation available.
var 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.
Console
The Console
allows scripts to log debugging, warning, or error information where it can be viewed in the system console or in the console output area. A single instance of Console
is available to scripts as the console
global variable.
function log(message:Object
, additional:Array of Object
or null)
Appends a line to the application console formed by concatenating the given message
(after converting it to a String
), any additional arguments separated by spaces, and finally a newline.
function error(message:Object
, additional:Array of Object
or null)
No documentation available.
function info(message:Object
, additional:Array of Object
or null)
No documentation available.
function warn(message:Object
, additional:Array of Object
or null)
Just calls Console.log
, currently.
function clear()
Clears the console in the user-visible window.
Data
A generic bag of bytes. Mainly useful to be interpreted / converted to some other type.
function fromString(string:String)
→ Data
Convert from a String
to the UTF8 encoding of that string as Data
function fromBase64(string:String)
→ Data
No documentation available.
function toString()
→ StringConvert to a String
, assuming that this Data
is encoded as UTF8.
function toBase64()
→ StringConvert to a Base–64 encoded string.
var length
→ Number or nil read-onlyNumber of bytes in this data.
Document
No documentation available.
function makeNew(resultFunction:Function
)
Create a new document, which can be populated with data and then presented. On iOS, if the document is not presented by the time the resultFunction
returns, it will be closed. On macOS, the document will be left around and accessible to the running script. The resultFunction
will be passed either the new document or an Error
if there was a problem creating the document.
function makeNewAndShow(resultFunction:Function
)
Create a new document and presents it. The resultFunction
will be passed either the new document or an Error
if there was a problem creating the document.
function close(didCancel:Function
or nil)
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 nil)
→ FileWrapper
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 undo()
Undo the last done action.
function redo()
Redo the last undone action.
function show(resultFunction:Function
or nil)
Presents the document, ordering the window forward on macOS, and possibly closing the existing document and opening the new on on iOS.
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 nil read-onlyThe file type identifier the document uses when saving, if set.
var name
→ String or nil read-onlyDocument name.
var writableTypes
→ Array of String read-onlyA list of all of the file types that this document can be written as.
FileWrapper
No documentation available.
function withContents(name:String or nil, contents:Data
or nil)
→ FileWrapper
No documentation available.
function filenameForChild(child:FileWrapper
)
→ String or nilReturns 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.
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 nil read-onlyReturns the regular file contents of the wrapper, if this represents a regular file. Otherwise, null
is returned.
var destination
→ URL
or nil read-onlyReturns the destination if this represents a symbolic link. Otherwise, null
is returned.
var filename
→ String or nilReturns 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 nilReturns 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.Type
No documentation available.
var 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.
FillType
No documentation available.
var Linear
→ FillType
read-onlyLinear Gradient.
var Marker
→ FillType
read-onlyMarker.
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.
Function
An object that represents a JavaScript function. This exists to allow exported API to declare that it wants a Function, not just any Object.
GraffleDocument
: Document
An OmniGraffle document.
var portfolio
→ Portfolio
read-onlyNo documentation available.
var windows
→ Array of NSWindow
read-onlyNo documentation available.
Graphic
An 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 nil)
Set the user data string attached to this graphic for a given key.
function duplicateTo(location:Point
, canvas:Canvas
or nil)
→ Graphic
or nilA 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.
var actionURL
→ URL
or nilURL 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
→ Rect
The 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 nilThe layer this graphic is on.
var locked
→ BooleanWhether this graphic is locked.
var name
→ String or nilThe 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 nilIf the stroke style is plastic, this is the depth of curvature.
var plasticHighlightAngle
→ Number or nilIf the stroke style is plastic, this is the highlight angle of the “light” shining on the plastic.
var rotation
→ NumberRotation of this graphic.
var shadowColor
→ Color
or nilColor of the shadow.
var shadowFuzziness
→ NumberFuzziness of the shadow.
var shadowVector
→ Point
Direction and length of the shadow.
var strokeCap
→ LineCap
Type of end cap on the stroke.
var strokeColor
→ Color
or nilColor of the stroke.
var strokeJoin
→ LineJoin
Type of join on segments of the stroke.
var strokePattern
→ StrokeDash
Dash pattern of the stroke.
var strokeThickness
→ NumberThickness of the stroke in points.
var strokeType
→ StrokeType
or nilType of stroke (the outline around the graphic).
var userData
→ ObjectUser data for this graphic
GraphicView
The view of the canvas in an OmniGraffle window.
function select(graphics:Array of Graphic
, extending:Boolean or nil)
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
→ Canvas
The canvas currently being displayed in this view.
var visibleRect
→ Rect
The rectangle of the canvas which is visible in the window.
Grid
Holds the grid settings for a particular canvas.
var drawsInFront
→ BooleanWhether the grid draws in front of all graphics or behind them.
var majorColor
→ Color
Color of the major grid lines.
var majorSpacing
→ NumberNumber of minor grid squares between each major grid line.
var minorColor
→ Color
Color 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.
Group
: Graphic
A set of grouped graphics represented by a single graphic. Groups can contain more groups, et cetera.
new Group(graphics:Array of Graphic
)
→ Group
Construct a new group containing the given graphics and replace those graphics on their original canvas with the group graphic.
function ungroup()
→ Array of Graphic
Remove 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 Point
Connection magnets on the group.
HierarchicalDirection
No documentation available.
var 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.
HopType
No documentation available.
var 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).
HorizontalAlignment
No documentation available.
var Center
→ HorizontalAlignment
read-onlyAlign to horizontal centers.
var Left
→ HorizontalAlignment
read-onlyAlign to left edges.
var Right
→ HorizontalAlignment
read-onlyAlign to right edges.
HorizontalTextAlignment
No documentation available.
var 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.
Image
No documentation available.
ImageReference
An 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 nil 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.
ImageSizing
No documentation available.
var Manual
→ ImageSizing
read-onlyManual.
var Stretched
→ ImageSizing
read-onlyStretched.
var Tiled
→ ImageSizing
read-onlyTiled.
Layer
A 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
)
→ Shape
Create a new graphic of a given shape and place it on this layer.
function newShape()
→ Shape
Create 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.
Layout
Graphic 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
→ HierarchicalDirection
The 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
→ LayoutType
Type of layout to perform: hierarchical, circular, radial, or force-directed.
LayoutType
No documentation available.
var 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.
Line
: Graphic
A graphic which is a line, potentially connecting two other graphics at its head and tail ends.
var allLineEndingTypes
→ Array of String read-onlyNo documentation available.
var bezierPoints
→ Array of Point
Array 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 nilGraphic 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
→ HopType
Style and behavior of line hops when this line passes over any other line on this canvas.
var lineType
→ LineType
Line type of this line. (Straight, Curved, Orthogonal, Bezier.)
var points
→ Array of Point
Array of control points for this line in canvas coordinates.
var tail
→ Graphic
or nilGraphic 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.
LineCap
No documentation available.
var 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.
LineJoin
No documentation available.
var 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.
LineType
No documentation available.
var Bezier
→ LineType
read-onlyBezier line.
var Curved
→ LineType
read-onlyCurved line.
var Orthogonal
→ LineType
read-onlyOrthogonal line.
var Straight
→ LineType
read-onlyStraight line.
NSWindow
No documentation available.
function close()
No documentation available.
var centerVisiblePoint
→ Point
No documentation available.
var selection
→ Selection
read-onlyNo documentation available.
OGOutlineNode
An 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 nil read-onlyGraphic that this outline node represents.
Object
An object to be exported to JavaScript. This keeps the value alive in JavaScript and so should not be held onto for long (since it will create retain cycles).
PlugIn
No documentation available.
function find(identifier:String, minimumVersion:Version
or nil)
→ PlugIn
or nilNo documentation available.
var all
→ Array of PlugIn
read-onlyNo documentation available.
function library(identifier:String)
→ Object
or nilLooks for a PlugIn.Library
in the receiver and returns it if found.
function action(identifier:String)
→ PlugIn.Action
or nilNo documentation available.
function handler(identifier:String)
→ PlugIn.Handler
or nilNo documentation available.
function resourceNamed(name:String)
→ URL
or nilNo documentation available.
function imageNamed(name:String)
→ Image
or nilNo documentation available.
var URL
→ URL
or nil read-onlyReturns the original URL from whence this PlugIn
came, if known.
var actions
→ Array of PlugIn.Action
read-onlyNo documentation available.
var displayName
→ String read-onlyReturns the localized, human-readable name for the PlugIn
.
var handlers
→ Array of PlugIn.Handler
read-onlyNo documentation available.
var identifier
→ String read-onlyThe unique identifier of the PlugIn
.
var libraries
→ Array of PlugIn.Library
read-onlyNo documentation available.
var version
→ Version
read-onlyReturns the current Version
for the PlugIn
.
PlugIn.Action
No documentation available.
new PlugIn.Action(perform:Function
)
→ PlugIn.Action
Returns a new PlugIn.Action
. Only used within an action JavaScript file embedded within a PlugIn.
var name
→ String read-onlyReturns the name of the PlugIn.Action
.
var perform
→ Function
read-onlyNo documentation available.
var plugIn
→ PlugIn
read-onlyReturns the PlugIn
that contains this object.
var validate
→ Function
or nilA function to check whether the action is supported, given the current application state, as determined by the arguments passed (typically including the selection). This optional Function may be configured while the Action
is being loaded, but after that the Action
will be frozen.
PlugIn.Handler
No documentation available.
new PlugIn.Handler(invoke:Function
)
→ PlugIn.Handler
Returns 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 nilAn 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 nilAn 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.Registration
No documentation available.
function remove()
Removes a previously added event observation.
PlugIn.Library
An object that represents a library from a plug-in.
new PlugIn.Library(version:Version
)
→ PlugIn.Library
Returns 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.
Point
No documentation available.
var 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)
→ Point
Returns a new Point
with the specified coordinates.
function add(point:Point
)
→ Point
Returns a new Point
that is the component-wise sum of the receiver and the argument Point
.
function subtract(point:Point
)
→ Point
Returns a new Point
that is the component-wise difference of the receiver and the argument Point
.
function scale(factor:Number)
→ Point
Returns 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
.
Portfolio
A Portfolio
represents the main contents of an OmniGraffle Document
and is used as the global object in any scripting session that is related to a particular document.
function addCanvas()
→ Canvas
or nilAdd a new canvas to the end of the current canvases.
function addImage(data:Data
)
→ ImageReference
or nilAdd 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 nilCopy an image from another document or stencil to this one.
var canvases
→ Array of Canvas
read-onlyList of canvases in the portfolio.
var document
→ GraffleDocument
or nil read-onlyNo documentation available.
var 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.
Rect
No documentation available.
new Rect(x:Number, y:Number, width:Number, height:Number)
→ Rect
Returns a new Rect
with the specified coordinates and size.
function insetBy(dx:Number, dy:Number)
→ Rect
No documentation available.
function offsetBy(dx:Number, dy:Number)
→ Rect
No documentation available.
function union(rect:Rect
)
→ Rect
No documentation available.
function intersect(rect:Rect
)
→ Rect
No documentation available.
function containsRect(rect:Rect
)
→ BooleanNo documentation available.
function containsPoint(point:Point
)
→ BooleanNo documentation available.
function intersects(rect:Rect
)
→ BooleanNo documentation available.
var center
→ Point
read-onlyNo documentation available.
var height
→ NumberNo documentation available.
var integral
→ Rect
read-onlyNo documentation available.
var isEmpty
→ Boolean read-onlyNo documentation available.
var isInfinite
→ Boolean read-onlyNo documentation available.
var isNull
→ Boolean read-onlyNo documentation available.
var maxX
→ Number read-onlyNo documentation available.
var maxY
→ Number read-onlyNo documentation available.
var midX
→ Number read-onlyNo documentation available.
var midY
→ Number read-onlyNo documentation available.
var minX
→ Number read-onlyNo documentation available.
var minY
→ Number read-onlyNo documentation available.
var origin
→ Point
No documentation available.
var size
→ Size
No documentation available.
var standardized
→ Rect
read-onlyNo documentation available.
var width
→ NumberNo documentation available.
var x
→ NumberNo documentation available.
var y
→ NumberNo documentation available.
Selection
The ‘selection’ argument to plugin actions, letting them inspect the selection.
var canvas
→ Canvas
or nil read-onlyThe currently selected canvas.
var document
→ GraffleDocument
or nil 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 nil read-onlyThe current view containing the selection.
Shape
: Solid
A ‘Solid’ graphic which has a particular shape, either one of the built-in shapes, or a custom bezier shape.
var shape
→ String or nilName of the shape for this graphic.
var shapeControlPoints
→ Array of Point
The 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 Point
Array of vertices for this shape.
Size
No documentation available.
new Size(width:Number, height:Number)
→ Size
Returns a new Size
with the specified width and height.
var height
→ NumberNo documentation available.
var width
→ NumberNo documentation available.
Solid
: Graphic
A 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
→ TextAutosizing
Autosizing behavior of the graphic when the text size changes.
var blendColor
→ Color
or nilThe middle color of a three color gradient fill, if the fill style includes such.
var blendFraction
→ NumberThe middle fraction of a three color gradient fill, if the fill style includes such.
var fillColor
→ Color
or nilColor of the fill for this graphic.
var fillType
→ FillType
or nilStyle 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 gradientCenter
→ Point
For radial gradients, the position of the center of the gradient.
var gradientColor
→ Color
or nilFor gradient fills, the second color (along with the fill color) that the fill goes between.
var image
→ ImageReference
or nilImage fill for this graphic, if any.
var imageOffset
→ Point
Positioning 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
→ Size
Scaling of the image fill. This is a multiplier between the displayed size and original image size.
var imageSizing
→ ImageSizing
Type of sizing behavior for the image, if any.
var magnets
→ Array of Point
Array of connection magnets for this graphic.
var text
→ StringText contents of this graphic.
var textColor
→ Color
Color 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 textGeometry
→ Rect
read-onlyDrawing bounds of the text in canvas coordinates.
var textHorizontalAlignment
→ HorizontalTextAlignment
Alignment 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
→ Rect
Size 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
→ VerticalTextPlacement
Alignment 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.
var tripleBlend
→ BooleanWhether the fill includes three colors in a gradient.
Stencil
A stencil containing graphics that can be copied to documents.
function load(completed:Function
)
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.
StrokeDash
No documentation available.
var Dash10on3off2on3off
→ StrokeDash
read-onlyNo documentation available.
var Dash10on3off2on3off2on3off
→ StrokeDash
read-onlyNo documentation available.
var Dash16on9off
→ StrokeDash
read-onlySixteen point dash segments with nine point gaps.
var Dash16on9off16on9off1on9off
→ StrokeDash
read-onlyNo documentation available.
var Dash16on9off1on9off
→ StrokeDash
read-onlyNo documentation available.
var Dash16on9off1on9off1on9off
→ StrokeDash
read-onlyNo documentation available.
var 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-onlyNo documentation available.
var Dash20on5off4on5off4on5off
→ StrokeDash
read-onlyNo documentation available.
var Dash2on2off
→ StrokeDash
read-onlyNo documentation available.
var Dash40on9off8on9off
→ StrokeDash
read-onlyNo documentation available.
var Dash40on9off8on9off8on9off
→ StrokeDash
read-onlyNo documentation available.
var Dash4on3off1on3off
→ StrokeDash
read-onlyNo documentation available.
var Dash4on3off1on3off1on3off
→ StrokeDash
read-onlyNo documentation available.
var Dash4on3off4on3off1on3off
→ StrokeDash
read-onlyNo documentation available.
var 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-onlyNo documentation available.
var 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-onlyNo documentation available.
var Solid
→ StrokeDash
read-onlySolid stroke with no dash pattern.
StrokeType
No documentation available.
var 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.
Subgraph
: Group
A ‘Subgraph’ is a type of ‘Group’ that can be expanded and collapsed to show or hide its contents.
new Subgraph(graphics:Array of Graphic
)
→ Group
No documentation available.
var 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
: Group
A ‘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
)
→ Table
No documentation available.
new Table(graphic:Graphic
)
→ Table
No documentation available.
function graphicAt(row:Number, column:Number)
→ Graphic
or nilRetrieve 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.
TextAutosizing
No documentation available.
var Clip
→ TextAutosizing
read-onlyClip.
var Full
→ TextAutosizing
read-onlyFull.
var Overflow
→ TextAutosizing
read-onlyOverflow.
var Vertical
→ TextAutosizing
read-onlyVertical.
Timer
No documentation available.
function once(interval:Number, action:Function
)
→ Timer
Makes a new Timer
that will fire once, after the specified interval (in seconds from the current time). When the Timer
fires, the passed in Function
is called, passing the Timer
as its argument.
function repeating(interval:Number, action:Function
)
→ Timer
Makes a new Timer
that will fire repeatedly with the specified interval (in seconds, with the first invocation happening that interval after the current time). When the Timer
fires, the passed in Function
is called, passing the Timer
as its argument.
function cancel()
No documentation available.
var interval
→ Number read-onlyNo documentation available.
URL
No documentation available.
function choose(types:Array of String)
→ URL
or nilAllows the user to choose a file URL
if possible and returns a new instance, or null
otherwise.
function chooseFolder()
→ URL
or nilAllows the user to choose a folder URL
if possible and returns a new instance, or null
otherwise.
function fromString(string:String)
→ URL
or nilParses the string as a URL
if possible and returns a new instance, or null
otherwise.
function tellScript(app:String, js:String, arg:Object
or nil)
→ URL
or nilCreates a URL
to invoke the given JS on the given app (url scheme) appropriate for use with the call function.
function fetch(callback:Function
)
Get the contents at the destination of this URL.
function call(success:Function
)
No documentation available.
function toString()
→ StringNo documentation available.
var string
→ String or nil read-onlyString representation of this URL.
Version
No documentation available.
new Version(versionString:String)
→ Version
Parses a string representation of a Version
and returns an instance, or throws an error if the string isn’t a valid version.
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.
VerticalAlignment
No documentation available.
var Bottom
→ VerticalAlignment
read-onlyAlign to bottom edges.
var Center
→ VerticalAlignment
read-onlyAlign to vertical centers.
var Top
→ VerticalAlignment
read-onlyAlign to top edges.
VerticalTextPlacement
No documentation available.
var 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.