The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Applescript to turn an xml file into a tree of shapes (http://forums.omnigroup.com/showthread.php?t=8171)

ianpiper 2008-06-13 06:56 AM

Applescript to turn an xml file into a tree of shapes
 
Hi all,

I picked up on a thread on this forum from last year, in which someone posted a method for creating a tree structure of shapes from a google sitemap file.

([url]http://forums.omnigroup.com/showthread.php?t=112[/url])

I was using this script happily in Omnigraffle Pro 4 but it breaks slightly in v5. The main problem is that it creates too many connections between parent and child objects: basically if you have a collection of urls like this:

[url]www.bob.com/foo/bar/1.htm[/url]
[url]www.bob.com/foo/bar/2.htm[/url]
..
[url]www.bob.com/foo/bar/14.htm[/url]

then you will get 14 connections between the shapes for [url]www.bob.com[/url] and foo and 14 between foo and bar. I can get around this if I can figure out a way for AppleScript to count how many lines there are between two shapes. I know that there is a count function in AppleScript, but is there a way in Omnigraffle 5 to tell whether there is a line connecting two shapes?

This leads me to the wider question: is there any documentation for Omnigraffle's AppleScript support? The kind of thing I am looking for is what the available options are for "head type" when creating a line (the Dictionary only says it is of type text). I found an example where you get a filled arrow like this:
set head type of aLine to "FilledArrow"

but that doesn't help if I want a hollow arrow (or a dotted line, or...).

If this information is documented anywhere else for other languages that would be a start: I don't mind doing a bit of exploring.

Thanks,


Ian.
--

ianpiper 2008-06-16 10:36 AM

Sorted
 
If anyone is interested (or even reading) I will be happy to share the solution to this question: it took a few hours and a couple of handfuls of hair, but it works nicely now.

Ian.
--

whpalmer4 2008-06-16 07:04 PM

Let's see it! I'm always interested in cool maps...


All times are GMT -8. The time now is 08:17 AM.

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