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
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