tell application "OmniGraffle" set thisWindow to first window set thisDocument to front document set thisCount to 0 set win_layers to (thisWindow's canvas's layers) set canvasName to (thisWindow's canvas's name) set area type of current export settings to current canvas -- First we have to make every layer except for the -- base layer invisible: repeat with win_layer from (count win_layers) to 1 by -1 set thisLayer to item win_layer of win_layers if win_layer = (count win_layers) then else set visible of thisLayer to false end if end repeat -- Now, let's switch them on - one after another - and -- create a PNG out of the result: repeat with win_layer from (count win_layers) to 1 by -1 set thisLayer to item win_layer of win_layers set visible of thisLayer to true set thisCount to thisCount + 1 set targetFile to (thisDocument's path & "-" & canvasName & "-" & thisCount & ".png") save thisDocument as "PNG" in POSIX file targetFile end repeat end tell