Re: AW: Export via Scripting Bridge / Modifying the selection of OmniGraffeDocument programatically
Tobias Wigger <[email protected]>
| Newsgroups | gmane.comp.graphics.omnigraffle.user |
|---|---|
| Message-ID | <C5278F16.28C7%[email protected]> |
Thx, using the answer to a support request to the Omni Support and the hint
of Christian the following applescript turned out to be working with
OmniGraffle 5.1 Beta 4.
It should also work with other versions of OmniGraffle 5.
set myFolder to POSIX path of (choose folder)
tell application "OmniGraffle Professional 5"
-- setup export settings
set area type of current export settings to selected graphics
set resolution of current export settings to 2.0
-- get selected graphics and iterate
set currentDocument to document of front window
set selectedGraphics to selection of front window
repeat with selectedGraphicsCount from 1 to (length of selectedGraphics)
set nextGraphic to item selectedGraphicsCount of selectedGraphics
-- export graphic
set selection of front window to {nextGraphic}
save currentDocument as "PNG" in POSIX file (myFolder & "graphic_" &
selectedGraphicsCount)
end repeat
end tell
At the moment it is based on AppleScript, probably there is a Possibility to
make it work with the scripting bridge in the future.
Thx for the help. I very much appreciate it.
Cheers!
Toby
>