Hello,
I am building a simple AppleScript that would export canvases of a document as an individual PNG files.
OmniGraffle version: 7.18.1 (v204.6.0)
MacOS version: 10.15.7
Googling and fiddling with examples I could build a script similar to the one below (I removed unessential canvas iteration lines and folder selection to simplify logic):
tell application "OmniGraffle"
set pngFile to "/Users/juriy/temp/export/example.png"
log "Saving file"
save front document in POSIX file pngFile
end tell
However I could not find the way to export with double resolution. The examples that I found on this forum suggest several ways to do that, neither of which seems to work in 2021.
The following line runs without errors, but no file is produced:
export front document scope "current canvas" as "PNG" to POSIX file pngFile with properties {resolution:2.0, scale:1.0}
The following line, suggested in another thread crashes OmniGraffle (I later found out that current export settings is a read-only object):
set size of current export settings to {495.1111, 278.5}
Although current export settings are read-only, it is in fact possible to set some settings, but not the others. For example, if I am adding this line before saving, the borders are added to the resulting image:
set border amount of current export settings to 150
At the same time, attempting to set scale and resolution in the same way doesn’t have any impact on the result:
set resolution of current export settings to 2
set export scale of current export settings to 4
Please help. What’s the suggested way to set the export properties that works in 2021?