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

 
Canvas to PDF Applescript Thread Tools Search this Thread Display Modes
Posting this as others may find it useful.

I've created this due to issues with image performance (even with DPI is boosted significantly) and wanting a clean way to export each canvas so I can link the individual items (PDFs in this case) in InDesign.

This script will
  1. Save PDFs in the same directory as the current Omnigraffle file
  2. Only work if one Omnigraffle document is open
  3. Overwrite when you re-run it
  4. Use canvas names for PDF naming

Code:
tell application "OmniGraffle Professional 5"
	activate
	set theDocument to front document
	set theCanvases to every canvas of theDocument
	set fileName to (name of theDocument)
	set filePath to (path of theDocument)
	set adjustment to (length of filePath) - ((length of fileName) + 8)
	set fileDirectory to texts 1 thru adjustment of filePath
	
	set canvasCount to count of canvases of theDocument
	
	set area type of current export settings to current canvas
	
	repeat with canvasNumber from 1 to canvasCount
		set cName to name of canvas canvasNumber of theDocument
		set cName to cName's words as string
		set canvas of front window to canvas canvasNumber of theDocument
		set saveLocation to (fileDirectory & cName & ".pdf")
		log saveLocation
		save theDocument in (saveLocation)
	end repeat
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript: user data item of canvas cyleigh OmniGraffle Extras 1 2011-05-04 09:59 PM
Use <%canvas%> variable to point to a different canvas? winterveg OmniGraffle General 2 2011-01-16 07:48 AM
Show next Canvas using AppleScript? aviflax OmniGraffle General 7 2010-02-12 11:39 AM
Linking Master Canvas items with child canvas layers relaxedguy OmniGraffle General 1 2007-12-11 04:15 PM
Applying master canvas to canvas dynamically draupp OmniGraffle Extras 1 2007-08-20 11:10 AM


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


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