Skip to main content

A command line utility that exports omnigraffle canvases files into various formats with a rubber support.

Project description

# OmniGraffle Export tool

A command line tool that allows to export one or more canvases from [OmniGraffle]( into various formats using [OmniGraffle AppleScript interface](

## Installation

In order to have it successfully installed and working, following is required:

* OmniGraffle 5
* python >= 2.6
* [appscript]( >= 0.22

You can either clone the repository and use the setup tool: install

Or using the PIP:

pip install omnigraffle_export

## Usage

Usage: omnigraffle-export [options] <source> <target>

-h, --help show this help message and exit
-c NAME canvas name. If not given it will be guessed from the target
filename unless it is a directory.
-f FMT format (one of: pdf, png, svg, eps). Guessed from the target
filename suffix unless it is a directory. Defaults to pdf
--force force the export
-v verbose

If the target file exists it tries to determine whether the canvas has been changed. It does that by comparing the checkums. Since the PDF export always results into a different file, it uses the PDF subject attribute to store there a checksum that will be generated by exporting to a PNG format.

## Examples

* Export _all_ canvases into directory _figures_ using EPS

`omnigraffle-export -f eps schemas.graffle figures`

* Export canvas named _FullModel_ into a _FullModel.svg_ SVG file:

`omnigraffle-export schemas.graffle FullModel.svg`

* Export canvas name _FullModel_ into a _my_new_model.pdf_ PDF file:

`omnigraffle-export -c FullModel -f pdf schemas.graffle my_new_model`


`omnigraffle-export -c FullModel schemas.graffle my_new_model.pdf`

_Note: that the '.pdf' suffix will be automatically added in the first case._

* Export _all_ canvases into directory _figures_ using EPS

`omnigraffle-export -f eps schemas.graffle figures`

## LaTeX Support Example

One of the main motivation for this package was to be able to quickly export OmniGraffle canvases and use them in LaTeX.
One of the possible setup is following:

* Every time a figure is included add some instruction so it can be later exported from OmniGraffle file. For example a comment like `% omnigraffle <path/to/.graffle/file> <output>` that would tell the exported to export a canvas `CondorKernel` from `sources/schemas.graffle` into `figures/CondorKernel.pdf` as PDF:

% omnigraflle: sources/schemas.graffle figures/CondorKernel.pdf

* An example preprocesor in python using [frabric](

from fabric.api import *
import re

# latex files to process
fnames = ['UCGridRLDecisionModel.tex']
omnigraffle_re = re.compile(r'%\s*omnigraflle:\s*([^ ]+)\s+([^ ]+)')

def _convert(source, target):
local('omnigraffle-export %s %s' % (source, target))

def schemas():
Generate all schemas

for fname in fnames:
with open(fname) as f:
for l in f:
m = omnigraffle_re.match(l.strip())
if m:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page