Omni
2009-10-09, 10:06 AM
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!!"