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

 
Automatically Diagram XML data? Thread Tools Search this Thread Display Modes
I have a more general question along the same lines as this thread:

Is there a repository of information somewhere that describes how to control OmniGraffle from Applescript? I have several projects that fitting OmniGraffle into the tool chain would be perfect for and I'm willing to learn Applescript to do it, but I can't seem to find documentation of the interface to OG. Perhaps I'm looking in the wrong places?
 
Quote:
Originally Posted by jgerman
I have a more general question along the same lines as this thread:

Is there a repository of information somewhere that describes how to control OmniGraffle from Applescript? I have several projects that fitting OmniGraffle into the tool chain would be perfect for and I'm willing to learn Applescript to do it, but I can't seem to find documentation of the interface to OG. Perhaps I'm looking in the wrong places?
Well, there are a few ways to do this - the easiest is cribbing from other people's scripts, or recording your own actions with script editor (in /Applications/AppleScript/)

You can discover the controls yourself by looking at the OmniGraffle (or any other application's) dictionary.

Best way to do that is to open up XCode (with the developer tools) and click File->Open Dictionary... A list your applications folder comes up, and omnigraffle should be there. Open it, and it shows you all the commands that OmniGraffle knows about. You can do the same in script editor too, but it's a PPC binary, and I'm trying to stay away from those. Plus Script Editor doesn't produce universal binary output, but AppleScript Studio (in XCode) does, and yup - they tend to be faster!

Then alls you have to do is figure out applescript, but there's much in XCode's documentation and on apple's developer web site to help out there.
 
Quote:
Originally Posted by jeremybrown
Well, there are a few ways to do this - the easiest is cribbing from other people's scripts, or recording your own actions with script editor (in /Applications/AppleScript/)

You can discover the controls yourself by looking at the OmniGraffle (or any other application's) dictionary.

Best way to do that is to open up XCode (with the developer tools) and click File->Open Dictionary... A list your applications folder comes up, and omnigraffle should be there. Open it, and it shows you all the commands that OmniGraffle knows about. You can do the same in script editor too, but it's a PPC binary, and I'm trying to stay away from those. Plus Script Editor doesn't produce universal binary output, but AppleScript Studio (in XCode) does, and yup - they tend to be faster!

Then alls you have to do is figure out applescript, but there's much in XCode's documentation and on apple's developer web site to help out there.
Fantastic, thanks for the quick response. I was wondering if that was the method for discovering what's scriptable in an app or not. Guess I have another project to work on this weekend.
 
Regarding the script I pasted in above - you'd do well to note that there's something like a 6:1 relationship of <loc></loc> tags to OmniGraffle objects. Somewhere around 1500 objects in OmniGraffle seems to be the practical limit of what you can call responsiveness. After that, the application becomes fairly sluggish (at least on my 2Ghz MacBook, with 2 GB RAM)

200 <loc> tags runs in mere minutes. 1100 tags requires hours.

You can optimize the script a little by commenting out/removing this bit:
Code:
					if (urlsRead mod 10) is 0 then
						tell canvas of front window
							layout
							page adjust
						end tell
					end if
Then the layout will adjust only at the end. It's not as entertaining to watch, but then if you're doing a thousand-file site, you're probably not going to see anything in the upper-left corner of the document anyhow ;)
 
I try using this script but cannot get it to save.
I get this message when trying:

Expected variable name, class name or property but found application constant or consideration.

Can anyone help?
 
Hi Jeremy -- I tried your AppleScript for reading XML data into OmniGraffle. I have the latest version of OG (Pro, 5.1) and when I try to compile the script I get the syntax error, "A to:front can't go after this back." in reference to the "set children to back to front ordering" statement. Any ideas?
 
*push*

if anybody got that script working again it would be pretty nice to see it updated here..

thanks in advance.
 
It would be great to see this updated, I'm on 5.1 and am having to same problem as above when compiling...

Anyone have an idea as to what's going wrong?

Cheers
 
Quote:
Originally Posted by darvanitis View Post
Hi Jeremy -- I tried your AppleScript for reading XML data into OmniGraffle. I have the latest version of OG (Pro, 5.1) and when I try to compile the script I get the syntax error, "A to:front can't go after this back." in reference to the "set children to back to front ordering" statement. Any ideas?
I just commented out that line (with -- in front) and it works fine.


Greetings
 
I'm trying to get the script to work, but not having success with my limited knowledge of Apple Script.

I compiled the script after commenting out the "set children" line, and that seemed to go OK. But after I saved the script as an application and ran it, nothing happened. I mean, the script ran for a second, then closed, without anything occurring.

I really would love to get this working. Any suggestions?
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I break process diagram into separate pages and display diagram name on every page Chien OmniGraffle General 0 2012-04-25 07:38 AM
Creating graphs automatically from imported data Angostura OmniGraffle General 2 2008-04-30 01:29 PM
automatically formatted imported data MAatHome OmniOutliner 3 for Mac 3 2007-12-04 07:32 PM


All times are GMT -8. The time now is 12:04 PM.


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