PDA

View Full Version : Apple-Script triggered exports of selection into separate images in OmniGraffle 5 Pro


Scifer_2008
2008-09-03, 07:01 AM
Hi All,

I'm trying to write a Apple Script to get the shapes in a selection exported into individual png files in Omni Graffle 5 Professional.

For that purpose, I modified the Applescript about exporting Canvases (http://forums.omnigroup.com/showthread.php?t=146&highlight=Graffle+Export+applescript):

tell application "Finder"
set saveFolder to desktop as string
end tell
tell application "OmniGraffle Professional"
tell canvas of document of front window
set shapeCount to count of shapes of selection
repeat with shapeNumber from 1 to shapeCount
set currentShape of selection to shapeNumber
save currentShape as "png" in (saveFolder & "ssh" & shapeNumber & ".png")
end repeat
end tell
end tell

The problem is, on execution of the Script I get the following error message:
" Can't make shapes of selection of canvas of document of window 1 of "OmniGraffle Professional 5" into type reference,

I am a relative newbie to AppleScript, so I'm probably missing something.

Any help would be greatly appreciated!!

Thanks in advance!

Toby