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

 
Applescript to turn an xml file into a tree of shapes Thread Tools Search this Thread Display Modes
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.

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

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:

www.bob.com/foo/bar/1.htm
www.bob.com/foo/bar/2.htm
..
www.bob.com/foo/bar/14.htm

then you will get 14 connections between the shapes for www.bob.com 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.
--
 
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.
--
 
Let's see it! I'm always interested in cool maps...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript - 2 problems in linking two shapes with a line RobTrew OmniGraffle General 4 2011-06-09 11:38 AM
Applescript - Tasks vs. Tree - huh? syncretist OmniFocus Extras 2 2008-09-07 12:08 PM
Applescript first steps. Joining shapes with a curvy line ivanrostas OmniGraffle General 0 2007-10-31 04:08 AM
relative positions for shapes in applescript herby OmniGraffle General 0 2007-08-07 12:59 AM


All times are GMT -8. The time now is 07:47 AM.


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