The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Omnigraffle XML format parsing Thread Tools Search this Thread Display Modes
Hello there omni community,

I believe I've done my due diligence to ensure this is not a repost, but feel free to smack me if it is.

I am trying to adapt omnigraffle for my own twisted purposes, and would like to be able to use Graffle as both a presentation layer and a reference document, but I would also like to extract pure graph data for use in my code. My code is only interested in links between nodes, node names, and possibly what a node contains.

Can anyone point me towards some kind of primer for the graffle xml format, so I can parse to my heart's content? Does anyone know if extracting these links is reasonably feasible?
 
Do you see yourself using OmniGraffle as the creation tool, and your code extracting information for further processing? How about having your code be the creation tool, and emit an OmniGraffle document? DOT/GraphViz format might be your friend here. I know that Omni uses it for visualizing OmniFocus sync graphs, for example.

Instead of figuring out how to parse the XML, another route would be to write an Applescript for OmniGraffle which communicates with your program in a convenient fashion.
 
I don't know if there's a primer, but the just looking at the XML probably tells one enough for extracting nodes and edges. The overall format is an Apple plist; as usual, the link to the DTD for that is in the file header. The XML is pretty much self-documenting; the names of the various elements and properties are self-explanatory.

The important element is the GraphicsList, an array of plist dictionaries, one for each object.

Lines that connect shapes have head and tail properties whose values are the IDs of the shapes connected. If the drawing is just nodes and edges that's pretty much all you need.

User-defined properties for an object might be helpful, too. The Note tab in the Properties inspector lets you enter key-value pairs. Those show up as the UserInfo property of the object in the graffle file. That might help you add easily-parsable information that your code can use.

As whpalmer4 said, you can also write an Applescript to extract the information you need and write it to some format convenient for your code.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import error: OmniGraffle Pro cannot open files in the "XML text" format MCV OmniGraffle General 5 2012-08-31 10:43 AM
Converting Omnigraffle to Visio format online Endorphins OmniGraffle General 0 2011-12-04 01:19 PM
Importing custom shapes into OmniGraffle - what format? jchap OmniGraffle General 2 2010-01-25 05:13 PM
Email item format not parsing correctly jeffreyP OmniFocus 1 for Mac 1 2007-12-05 07:38 PM
Parsing email? carllerche OmniFocus 1 for Mac 5 2007-12-02 12:52 PM


All times are GMT -8. The time now is 02:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.