Canvas Metadata

One of the great power-user features of OmniGraffle is the ability to assign metadata to objects. Assigned metadata can then be retrieved and used in automating the construction and formatting of documents. Very powerful indeed!

This webpage describes the various canvas metadata properties and methods that are available for your use in creating automated publishing tools.

Metadata Properties

Every canvas has two basic metadata properties: id and name. The id and name properties can be used to identify a canvas.

function canvasWithID(canvasID){ for(i = 0; i < canvases.length; i++){ if (canvases[i].id === canvasID){ return canvases[i] } } errorString = "There is no canvas with id: " + canvasID.toString() new Alert('ERROR', errorString).show(function(result){}) throw new Error(errorString) } canvasWithID(1)
function canvasWithName(canvasName){ for(i = 0; i < canvases.length; i++){ if (canvases[i].name.localeCompare(canvasName) == 0){ return canvases[i] } } errorString = "There is no canvas named: " + canvasName new Alert('ERROR', errorString).show(function(result){}) throw new Error(errorString) } canvasWithName('iPad Horizontal')

Notes and User-Data Keys

The Canvas class does not directly support the notes and userData properties used by graphics to store and retrieve data. However, the value of the canvas background property is a Solid Graphic that inherits the metadata properties and methods of a Graphic.[0].selection.canvas.background

Since it is a Graphic, the background shape of every canvas supports the two basic Graphic metadata properties: notes and userData.

The notes property can store a description or other textual data related to the canvas.

cnvsBackground =[0].selection.canvas.background cnvsBackground.notes = 'How Now Brown Cow'

The metadata properties of a canvas can be viewed and edited within the Canvas tab of the information sidebar on both macOS (left) and iOS (right).


User-Data Keys are one or more user-defined pairs of key names and data values that are assigned to a graphic object. A key could be any type of identifier, such as a SKU or product number, or a person’s name. The key value can be any type of data expressed as a string.

Graphic Metadata Methods

Here are Graphic instance methods for getting and setting user data keys and values:

A function for setting user data:

function setCanvasUserDataForKey(key,value){ graphic =[0].selection.canvas.background graphic.setUserData(key,value) } setCanvasUserDataForKey('SKU','W123456789')

A function for getting user data. The result will be 'undefined' if no matching key is found:

function getCanvasUserDataForKey(key){ graphic =[0].selection.canvas.background return graphic.userData[key] } getCanvasUserDataForKey('SKU')

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.