Re: Bulk replacement of text from spreadsheet or text file

Ian Piper <[email protected]>
Newsgroups gmane.comp.graphics.omnigraffle.user
Message-ID <[email protected]>
> In fact any sample code at all that talks
> to OG would be a great starting point - I'm sure I could figure out  
> the
> specifics of creating objects easily from there.


I wrote some sample AppleScript code that will take a dropped xml file  
and convert it to an Omnigraffle 5 diagram. You can get it here:

http://www.tellura.co.uk/examples/xml_to_omnigraffle_example.zip

The zip file contains a source xml file, AppleScript script file and  
corresponding app file and the resulting graffle file. It also  
contains the Satimage XMLLib plugin: you need this to do the DOM  
parsing. You may like to download the latest version of the latter: (http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html 
). The osax file needs to go in the folder /Library/ScriptingAdditions.

To run it, drop source.xml onto the "Drop xml file here" icon. This  
will kick off Omnigraffle and build the diagram based on the xml file.

Hopefully this will give some pointers to building Omnigraffle  
diagrams with AppleScript. BTW one thing I have found really nice  
about doing this is using the user-defined properties. You can set key- 
value pairs to store your own custom data inside your diagram objects.  
The other thing (this example demonstrates this) is that if you set  
the url property for an object you can then (either in OG or in an  
exported pdf or html rendition) click on an object (in Action Browse  
mode) to load a url in your web browser. Works really nicely.

Anyway, hope this helps.

Regards,


Ian.
-- 
Ian Piper
Tellura Information Services - the web, document and information people
Registered in England and Wales: 5076715, VAT Number: 874 2060 29
http://www.tellura.co.uk/
01926 811574 | 07590 685840
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.