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 lots of drawings to PDF Thread Tools Search this Thread Display Modes
I thought maybe I should just say what I really want to do and see if anyone can point me in the right direction.

I have about 50 OG drawings that I need other people to review. Some of them have OG, but others don't, and some are using Windows machines. The common format we can all look at are PDF files.

I don't want to open and export all of the files by hand. I was hoping there would be a way to do this using either AppleScript or Automator. I haven't used either in the past, but when I opened Automator I didn't see any OG actions, and when I opened the OG Pro dictionary in the AppleScript editor, I didn't see anything that would let me either export to PDF or print to PDF.

If there were a command line interface to OG, I would be golden, because I can write shell and Python scripts like a... well, let's just say that I know how to write those.

Does anyone have any suggestions for me?

Thanks,
Rush
 
Do you mean the drawings are all in the same, single OmniGraffle file or that they are spread across 50 different files?

If the former I assume you can't or don't want to simply print the whole document for people to view?

From the "it just might work" school: if they are separate files, could you create and use a desktop printer to drag and drop print each file?

(Btw, I doubt I'll be able to help if you do answer this as I don't do scripting at all, but I think you need to be more precise about what it is you need before others can chime in).
 
My drawings are spread across 50 different files.

Here's the command line equivalent of what I want to do:
find . -name "*.graffle" -exec TellOmniGraffleToExportThisFileToPdf {} \;

where TellOmniGraffleToExportThisFileToPdf is the mythical, nonexistent OG command line interface that I wish existed.

- Rush
 
I wish this existed too. I don't want to have OG load and display my document just to export it as an image. I'd love to see all of the File > Export... options supported in a command line interface, so I can export transparent-background PNGs too.
 
This is a very old AppleScript, so it may take some tweaking, but it will take a number of selected .graffle files in the Finder and export them to PDF:

Code:
tell application "Finder"
	repeat with theFile in selection as list
		my convert_to_pdf(theFile, "pdf")
	end repeat
end tell

on convert_to_pdf(graffleAlias, fileType)
	tell application "OmniGraffle Professional 5"
		open graffleAlias
		set rawPath to path of document 1 as string
	end tell
	searchReplace(rawPath, ".graffle", "")
	set rawPath to the result
	tell application "OmniGraffle Professional 5"
		set myPath to POSIX path of (rawPath & "." & fileType)
		--display dialog myPath
		save first document in myPath as fileType
		--close first document
	end tell
end convert_to_pdf

on searchReplace(theText, SearchString, ReplaceString)
	set OldDelims to AppleScript's text item delimiters
	set AppleScript's text item delimiters to SearchString
	set newText to text items of theText
	set AppleScript's text item delimiters to ReplaceString
	set newText to newText as text
	set AppleScript's text item delimiters to OldDelims
	return newText
end searchReplace
Hope it helps,
__________________
"Vroom! Vroom!!"
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Size of drawings.... you gotta be kidding me legatony OmniGraffle General 0 2013-04-02 03:33 AM
Does OmniGraffle finally resize text with drawings? Stokestack OmniGraffle General 6 2011-10-15 07:37 PM
OmniGraffle 5 Pro Rescaling OG 4 Pro Drawings DarylF2 OmniGraffle General 10 2010-09-02 10:15 AM
Problem Marking up drawings dghpts OmniGraffle General 0 2010-04-14 12:22 PM
Drawings not opening lennie OmniGraffle General 1 2007-10-21 10:24 AM


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


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