We’ve built a lot of extra goodies into OmniGraffle 6.1, including the ability to import and export files from other apps on your Mac. This is particularly important for users of Microsoft® Visio® or Adobe® Photoshop®, but you’ll need to upgrade to OmniGraffle Pro to import and export to these formats.
In addition to import/export, this section touches on some of the following advanced features of OmniGraffle:
Several different file formats can be understood by OmniGraffle. You can import these files by opening them just as you would open a normal OmniGraffle file (File ▸ Open, or Command-O).
(Pro) Microsoft® Visio® documents, templates, and stencils (.vsd, .vdx, .vst, .vtx, .vss, .vsx)
DOT files (.dot)
Diagram! 2 documents (.diagram2 and .dpalette2)
OmniOutliner documents (.ooutline and .oo3)
When you open an OmniOutliner file, the items of the outline are interpreted as a diagram. A dialog appears; use it to indicate exactly how to interpret the outline:
Use the pop-up list to choose a diagram style.
(Pro) Use the table to assign objects in the diagram style to columns in the outline. If you want to show multiple columns of information for each item, use a diagram style that has grouped objects. You can also assign a column to the objects’ notes.
(Pro) Choose whether to put the outline in a completely new document or in a new canvas on the open document.
(Pro) Xcode projects (.xcode), Project Builder projects (.pbproj), and frameworks (.framework)
(Pro) Interface Builder nib files (.nib)
EOModeler files (.eomodeld)
Folder structures
You can create files of several different types from your OmniGraffle diagrams. Choose File ▸ Export (Option-Command-E). When you export, a new file is written to the disk, leaving your original document as it is on the screen. Of course, not all aspects of a diagram can be represented in all file formats.
The available file formats are:
Depending on the file format you choose, you have different options. Most offer an Export Area option, with which you can choose how much of the document to export.
Depending on the format you choose, you can also choose a scale for exporting smaller or larger than actual size, the resolution, the compression level, and whether to make the background transparent.
OmniGraffle has extensive AppleScript support, making it easy for you to automate tasks within or to create entirely new OmniGraffle projects. To find out more about how OmniGraffle’s AppleScript object model and commands, launch AppleScript Editor (/Applications/Utilities, or use Shift-Command-U while in the Finder), choose File ▸ Open Dictionary, and then choose your version of OmniGraffle from the Open Dictionary dialog.
You can store AppleScripts in OmniGraffle’s scripts folder, for easy access from the Scripts menu. You can also attach scripts to individual objects on a canvas, using the Action inspector. When you activate the Browse tool, then click an object with a script attached, the script runs.
If you select some objects and then choose Edit ▸ Copy As ▸ AppleScript from the menu bar, you get the exact lines of AppleScript necessary to create those objects. This is a great way to learn how OmniGraffle’s AppleScript support works, or to add specific objects to your own scripts.
LinkBack is a way of embedding content between applications in such a way that you can always go back and edit the content with the software used to create it originally.
For lots of information about LinkBack, and a list of applications that support it, check the LinkBack repository on GitHub.
To embed OmniGraffle content in another LinkBack application, just copy and paste the content like you would normally. The same goes for embedding other applications’ content in OmniGraffle diagrams.
To embed OmniGraffle content inside a single object in OmniGraffle, select all of the objects on your canvas (Command-A), choose Edit ▸ Copy As ▸ PDF from the menu bar, and then Paste (Command-V). The objects you copied become a single image; double-clicking the object opens a new OmniGraffle window in which you can edit the objects to your heart’s content.
To edit OmniGraffle content embedded in another application:
Double-click the OmniGraffle content in the other application’s document; an OmniGraffle window appears containing the content.
Edit the content in the OmniGraffle window, just as you normally would.
In OmniGraffle, choose File ▸ Save; the content in the other application updates automatically.
To edit other LinkBack applications’ content embedded in an OmniGraffle diagram, just double-click it. When you save in the other application, the content in the OmniGraffle diagram updates.
OmniGraffle’s Find dialog supports the use of some simple regular expressions. A regular expression is a single string that represents a whole set of strings. The following syntax is used:
a*
— zero or more instances of a
(matches the longest string possible)a*?
— zero or more instances of a
(matches the shortest string possible)a+
— one or more instances of a
(matches the longest string possible)a+?
— one or more instances of a
(matches the shortest string possible)a?
— zero or one instance of a
^
— beginning of a line$
— end of a line.
— any character[a-z]
— all characters between a
and z
[abc-]
— a
, b
, c
, or -
(abc)
— matches abc
and stores it as a group. Use the Select or Replace pop-up menu in the Find dialog to select or replace only one of these groups rather than the whole expression.\1
— text of first matched groupa|b
— a
or b
\n
— newline\r
— carriage return\t
— tab character\d
— digit\D
— non-digit\w
— word character (alphanumeric or underscore)\W
— non-word character\s
— whitespace\S
— non-whitespace\
— escape the next characterRegular expressions are very popular, so you should be able to find plenty of information about them on the internet or in a good library or bookstore. Here are a few examples to get you started:
&\s*$
— matches whitespace at the end of a line.<.*?>
— matches strings that begin with <
and end with >
, such as XML tags.&\S+@\S+
— very liberally matches things that resemble email addresses (anything@anything).(19|20)\d\d-\d\d?-\d\d?
— matches dates in the format YYYY-MM-DD, between 1900 and 2099