Hi RobTrew,
Thanks for the answer. It worked.
I think the following is my final question before I get this script working fully..
Let's say again, I have 10 canvases, and I have a loop like this
Code:
tell application "OmniGraffle Professional 5"
set theCanvases to every canvas of the first document
set myCanvas to fourth canvas of the first document
set numCanvas to 0
set maxItemsPerCanvas to 3
tell the first document
repeat with theCanvas in theCanvases
tell myCanvas
--@CODE TO DRAW SOMETHING
end tell
set numCanvas to numCanvas + 1
if numCanvas > maxItemsPerCanvas then
set myCanvas to canvas after myCanvas --@HERE
set maxItemsPerCanvas to maxItemsPerCanvas + maxItemsPerCanvas
end if
end repeat
end tell
end tell
@HERE : I wanted to set myCanvas to the next Canvas in the document after myCanvas. But this code doesn't work. It is essentially "set myCanvas to fifth canvas" but I want to do this without hardcoding it.