OmniGraffle 3.10 Reference Manual for iOS

Appendix F

Data Variables

In OmniGraffle, a data variable is a string that you can use to insert object and line labels based on other information in your document. These variables look for like-named elements in an OmniGraffle document’s XML source, and displays its corresponding data related to the string provided. For example, you can use the <%Layer%> data variable as a text object on the canvas to display the name of that layer.

Use of the <%UserData%> variable gives OmniGraffle Pro users access to document-level details and metadata entered into the Canvas Metadata inspector.

Universal Data Variables

OmniGraffle Standard and Pro both have access to a core set of data variables, listed in the following table.

Variable Description
Canvas and Layer Variables
<%Canvas%> Displays the canvas name.
<%CanvasNumber%> Displays a number related to the canvas’s position in the Sidebar.
<%TotalCanvases%> Displays the total number of canvases in the document.
<%Layer%> Displays the name of the layer.
Document-specific Variables
<%Document%> Displays the filename of the OmniGraffle document.
<%Creator%> Displays the user name of the person who created the document.
<%Modifier%> Displays the user name of the person who last modified the document.
<%#%> Displays the current page number, based on the object’s position on the canvas as it relates to how the page is printed.
<%TotalPages%> Displays the total number of pages to be printed from the document.
Date Variables
<%Date%> Displays today’s date.
<%CreationDate%> Displays the date the document was created.
<%ModificationDate%> Displays the date that the document was last modified.
Date Strings for use with Date Variables
y Two-digit year, based on the decade; for example, 16 for “2016”.
Y Four-digit year; for example, 2016.
m Month, represented as two digits ranging from 01-12; for example, 10 for October.
d Day, represented as two digits ranging from 01-31 (as appropriate); for example, 05 is the fifth day of the month.
c Current date and time; for example, Tue Jul 11 10:00:00 PDT 2017.
H Hours, represented as two-digits ranging from 00-23; for example, 11 is 11 a.m., whereas 23 is 11 p.m..
M Minutes, represented as two digits ranging from 00-59.
S Seconds, represented as two digits ranging from 00-59.
z Zulu time difference; for example, an output of -0700 represents that the current time is seven hours behind Zulu time.
Object-specific Variables
<%X%> Displays the object’s horizontal distance from the origin.
<%Y%> Displays the objects vertical distance from the origin.
<%Width%> Displays the object’s width.
<%Height%> Displays the object’s height.
<%Length%> Displays a line object’s length.
<%GraphicName%> Displays the name of the object.
Document Data Inspector Variables
<%Subject%> Displays the Subject of the field of the Document Data inspector.
<%Copyright%> Displays information entered in the Copyright field of the Document Data inspector.
<%Version%> Displays information entered in the Version field of the Document Data inspector.
<%Description%> Displays information entered in the Description field of the Document Data inspector.
<%Comments%> Displays information entered in the Comments field of the Document Data inspector.
<%Authors%> Displays the author, or authors, listed in the Authors field of the Document Data inspector.
<%Organizations%> Displays information entered in the Organizations field of the Document Data inspector.
<%Languages%> Displays the language, or languages, entered in the Languages field of the Document Data inspector.
<%Keywords%> Displays the keyword, or keywords, entered in the Keywords field of the Document Data inspector.
<%Projects%> Displays the document, or documents, entered in the Projects field of the Document Data inspector.

Date Strings Used by the Date Variables

As noted in the previous table, OmniGraffle has three date-specific variables that make it easy for you to track the status of work on your documents.

  • Current Date (<%Date%>) — inserts the current date. This particularly handy when you want to “stamp” a document you’re exporting or printing with today’s date.

  • Document Creation Date (<%CreationDate%>) — inserts the date that the document was originally created, according to the document XML.

  • Document Modification Date (<%ModificationDate%>) — inserts the date that the document was last saved, according to the document XML.

The date variables are particularly useful when combined with the <%Creator%> and <%Modifier%> variables, when you need to see who last updated a document file.

If you are using one of the date variables, you can customize the format of the date using the variables. For example, to get a date such as 2017-10-05 08:37:30 -0700Z, you could use the following variable string:

<%date %Y-%m-%d %H:%M:%S %zZ %>

The logic we have used in creating the date variables is based on Cocoa’s date formatting tokens.