I'm trying to duplicate an object from one Omnigraffle document into another. I can get it to duplicate and place the copy in the same spot, but when I try to place the copy in a different file, I get an error: "OmniGraffle 5 got an error: Can’t make or move that element into that container."
The script is below. Any suggestions would be greatly appreciated.
The script is below. Any suggestions would be greatly appreciated.
Code:
set myDocument to "[the pathname of my file]" tell application "OmniGraffle 5" set oDoc to open myDocument set canvasCount to count of canvases of oDoc set allGroups to {} repeat with theCanvas in every canvas of the first document repeat with theLayer in every layer in theCanvas set allGroups to allGroups & every group in theLayer end repeat end repeat set groupcount to length of allGroups set allDocNames to {} repeat with currentGroup in allGroups set currentID to id of currentGroup set currentName to "test" & currentID & ".graffle" set allDocNames to allDocNames & currentName set preNewDoc to (make new document at end of documents with properties {name:currentName}) save the front window set newDoc to the front window duplicate currentGroup to newDoc -- causes error! (* in new document, select all ungroup keep list of origins export as psd in illustrator import each component to the location specified by its origins *) end repeat end tell