Script to Import VDX Files

Using OmniGraffle 5 I was able to run this script:

tell application id “GRfl”

import "/test/vxd/test.vdx"
set objFile to front document
save objFile as "png" in ("/Users/ekimber/temp/test/test.png")

end tell

And it worked fine.

I just now upgraded to 6.2.5 and the same script (using ID "com.omnigroup.OmniGraffle6 " fails with:

error "OmniGraffle got an error: The document “test.vdx” could not be opened. " number 2

I can open the VXD file using the File->Open dialog, so I know the file is good.

What do I need to do in version 6 to be able to open a VXD file and then export it as PNG in a script?



If I change the script to:

tell application id “com.omnigroup.OmniGraffle6”
make document
tell canvas of front window
make new shape at end of graphics with properties {draws shadow:false, size:{117.0, 97.875}, origin:{-40.5, -13.5}}
end tell

set objFile to front document
save front document as "png" in ("/Users/ekimber/temp/test/test.png")

end tell

I get an error dialog:

The document “Untitled 4” could not be exported as “test.png”. You don’t have permission.

Again, this same script worked in version 5 so I’m wondering what changed and where I would find the documentation that would answer my scripting questions. The OmniGraffle User Manual does not cover scripting to this level of detail.

Configure the import mapping

Additionally, in ARIS Business Architect, the way how Visio drawings are mapped to ARIS models can be configured. Only script administrator users are allowed to perform this task. Go to the “Administration” module, navigate to the “Report” section and the category “Visio-Import” below it. Here you find the mapping file (“mapping.xml”). Right click this item and choose the option “Configure Visio Mapping”:

how to change import mapping for Microsoft Visio in ARIS

Subsequently, the currently active mapping is displayed. All other (non-mapped) Visio diagram types are – if they are imported into ARIS – mapped to a “Quick model”.

Overview of mappings between Microsoft Visio and ARIS model types

Here you can change the way a Drawing is mapped to an ARIS model (“Edit”) or add a mapping, defining how to handle a drawing while importing it to ARIS in 3 steps:

Select the Visio drawing type to be mapped and the target ARIS model type
Define which ARIS symbols should be used for each Visio shape.
users can define an ARIS symbol for each shape
users can specify that a specific shape should not be imported
users can define that a specific shape should not be mapped to an ARIS symbol but to a graphical shape along with a free-form text
There is no need to specify all mappings. Users can define a combined mapping for “all unmapped shapes” to a specific symbol.
Since ARIS has typed connections between its symbols, this page shows which connection is used in ARIS with the possibility to choose a specific connection if more than one connection type is possible.

For example, let’s examine how Visio organizational charts are mapped to ARIS Organizational charts. This is how the organizational chart looks like in Visio:

organisational chart in Microsoft Visio

The first page of the mapping configuration tells ARIS to map the Visio organizational chart drawing to an ARIS organizational chart model:

first page of Microsoft Visio import wizard

On the second page, you define how the organizational chart shapes are mapped to the symbols in an ARIS organizational chart. In Visio, the following shapes are available to the user:

Microsoft Visio shapes (organisational chart)

One after the other, you can assign an ARIS symbol to each Visio shape:

symbol mapping between Microsoft Visio and ARIS Business Architect

A completed mapping could look like this:

completed symbol mapping between ARIS Business Architect and Microsoft Visio

Here, all relevant shapes have a symbol assigned. All other stuff is mapped to graphical objects and/or free-form texts.

As a result, the model above looks like this after importing it into ARIS:

imported Microsoft Visio organisational chart in ARIS Business Architect

With this new feature it is very easy to import Microsoft Visio Drawings into ARIS. You don’t need to rely on a predefined mapping, but can change the mapping between Microsoft Visio shapes and ARIS objects on your own.