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 Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Omnigraffle script cannot save file Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
I have a simple script that exports the current canvas to a PDF file in the same directory as the .graffle file. It is very useful for putting figures in svn for those that don't have omnigraffle.

The problem is when moving from omnigraffle 5 pro to OG 6pro the script doesn't work. If I export the file by hand using the menu systems, then the script works. Even if I remove the pdf file!

Did some sort of set up command change in the dictionary? What can I do to get this script to work in OG 6 pro?


Here is the script

Code:
tell application "OmniGraffle"
	set thedocument to front document
	#set thePath to POSIX path of the folder of thedocument
	set thePath to the path of the thedocument
	set ASTID to AppleScript's text item delimiters
	set AppleScript's text item delimiters to "/"
	set newName to (text items 1 through -2 of thePath) as text
	set AppleScript's text item delimiters to ASTID
	
	# Save the original canvas for restoration
	set originalCanvas to canvas of front window
	
	# Confgure the output type to all graphics
	# Which will be interpreted as "current canvas" in PDF and EPS files
	set area type of current export settings to all graphics
	
	set currentName to name of originalCanvas as text
	# this assumes a good canvance name for the file
	#set cleanName to replace_string(currentName, " ", "_") of me
	set cleanName to currentName
	# Save as PDF
	set outputFile to newName & "/" & cleanName & ".pdf"
	#display dialog outputFile
	save front document in outputFile
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -8. The time now is 12:51 AM.


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