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

 
Automating OO3 --> OG outline diagramming Thread Tools Search this Thread Display Modes
I like to frequently diagram an outline argument that I am drafting in Omnioutliner.

So far, the Applescript that I am using to make an OG diagram from the currently selected 003 lines looks like this:

Code:
(* This assumes that some rows are selected in OmniOutliner *)

on run
	
	-- SAVE A FRESH OO3 DOC USING JUST THE SELECTED LINES
	
	tell application "OmniOutliner Professional"
		set MyDoc to front document
		
		
		set FirstRowID to id of first selected row of MyDoc
		set FirstRow to a reference to row id FirstRowID of MyDoc
		set MyRowIDs to id of every selected row of MyDoc
		
		set oNewDoc to make new document
		set oNewFirst to make new row at end of oNewDoc
		
		repeat with MyRowIndex from 1 to count of MyRowIDs -- force forward loop
			set MyRowID to item MyRowIndex of MyRowIDs
			duplicate row id MyRowID of MyDoc to before oNewFirst
		end repeat
		delete last row of oNewDoc
		
		set FilePath to (POSIX path of (path to desktop) as string) & "foobar2.oo3" as POSIX file
		save oNewDoc in FilePath
		close oNewDoc
	end tell
	
	-- IMPORT THE SAVED DOCUMENT INTO OMNIGRAFFLE
	
	-- Assumes following settings
	---- View>Page_Breaks :OFF
	---- View>Zoom>Fit in Window
	--In Canavas Size inspector:
	---- Size is multiple of printer sheets OFF
	----Auto-adjust the canvas size ON
	----Print canvas on one printer sheet ON
	
	tell application "OmniGraffle Professional 5"
		activate
		set strPath to POSIX path of FilePath as string
		try
			set oDoc to import strPath
		end try
	end tell
end run
If I remove the try ... end try from the closing lines, however, I get a puzzling error message about the impossibility of converting the OG application into a reference ...

This syntax glitch (bug?) is annoying as I would like to extend the script to automatically use a particular style-sheet. Any thoughts ?
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making an Automating Exporting Script Tado OmniFocus 1 for Mac 0 2012-08-11 07:24 AM
Applescript help: Section copy Automating ptorngaard OmniOutliner 3 for Mac 3 2011-02-01 10:13 PM
Recommended Diagramming Books? sw001 OmniGraffle for iPad 2 2010-05-01 09:35 AM
Network diagramming in Omnigraffle? odaugaard OmniGraffle General 1 2009-06-29 08:01 AM
Importing an MS outline for auto-diagramming? zeeebus OmniGraffle General 2 2009-06-28 11:21 AM


All times are GMT -8. The time now is 04:34 AM.


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