--Copyright 2009, Sunny Fugate
--Creative Commons Attribution-Share Alike 3.0
--http://creativecommons.org/licenses/by-sa/3.0/us/
--

tell application "OmniGraffle Professional 5"
	--Setup export options
	set current export settings's area type to selected graphics
	set current export settings's draws background to false
	set current export settings's export scale to 1
	set current export settings's include border to false
	set current export settings's resolution to 2.0
	
	--Retrieve the desired output export path	
	set myFolder to POSIX path of (choose folder)
	
	--Get the desired output format
	set outputTypeList to {"PDF", "TIFF", "PNG", "GIF", "JPEG", "EPS", "SVG", "PICT", "BMP"}
	choose from list outputTypeList with prompt "Choose export format"
	set exportformat to result as text
	
	--Get the desired file prefix
	set prefixDialog to display dialog "Enter a desired output file prefix or leave blank" default answer ""
	set filePrefix to the text returned of prefixDialog
	
	--Get the current document for later use	
	set currentDocument to document of front window
	
	--Get a list of the canvases
	set theCanvases to every canvas of currentDocument
	
	
	--Use a counter for unique naming
	set counter to 0
	
	--Loop over each canvas
	repeat with aCanvas in theCanvases
		--Make sure that the current canvas is displayed 
		--(export of currently selected only works in the displayed window
		set canvas of front window to aCanvas
		
		--get a list of groups for this canvas
		set theGroups to every group of aCanvas
		get theGroups
		
		--loop over each group
		repeat with aGroup in theGroups
			get aGroup
			
			--Set the selection of the window and save / export
			set selection of front window to {aGroup}
			save currentDocument as exportformat in POSIX file (myFolder & filePrefix & (counter))
			set counter to counter + 1
			
		end repeat
	end repeat
	
end tell
 
software/applescript/omnigraffle_export_all_groups.txt · Last modified: 2009.08.21 00:23 by sunny
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki