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

 
export as png fails, format number -50 Thread Tools Search this Thread Display Modes
I've been working on a script to export as png.
pdf works no problem, but not png.

So i reverted to a script on this page from sunnyinsight 2009

I get the same problem, pdf is ok, but jpeg and png don't work, hmm some kind of codec issue perhaps?

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 graphic of aCanvas
get theGroups

--loop over each group/graphic
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




Product: OmniGrafflePro-5.4.x
Tag: OmniGraffle/5.4/GM-v135.7
Date: 2012-05-24 12:40:08 -0700
Builder: omnibuild
Host: tb107a.private.omnigroup.com
Revision: 167456

Xcode: /Applications/Xcode.app/Contents/Developer
Xcode 4.3
Build version 4E109
 
the save as <format> in <file> doesn't work.

I came across some other post that mentions that omnigraffle will determine format based on the file extension.

I'm sure i tried a whole host of variations, but there you go.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export oo3 to excel format mjw OmniOutliner 3 for Mac 11 2014-04-03 10:57 AM
Showing/Hiding Layers Fails To Export To PDF pixel_pirate OmniGraffle General 6 2013-10-29 10:22 AM
Visio Export doesn't export pattern fill [A: limitation of Visio file format.] BradP OmniGraffle General 4 2012-02-25 03:50 PM
Microsoft XML Export Fails to Load in MS Proj 2003 HeelToe OmniPlan General 8 2007-01-05 03:14 PM
Custom number format (newbie alert!) Toontje OmniOutliner 3 for Mac 3 2006-08-28 10:53 PM


All times are GMT -8. The time now is 03:30 PM.


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