The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   reference of result of duplicate command in applescript? (http://forums.omnigroup.com/showthread.php?t=25384)

ericscheid 2012-09-05 09:50 PM

reference of result of duplicate command in applescript?
 
Consider this code to duplicate a selected graphic

[CODE]tell application "OmniGraffle Professional 5"
set theSelection to the selection of front window
set theObject to item 1 of theSelection
duplicate theObject
end tell[/CODE]

How do I get a reference to the new graphic?

RobTrew 2012-09-05 10:25 PM

You can duplicate it to a particular position in the graphics collection, and then reference the graphic at that position:

[CODE]tell application id "OGfl"
tell front window
set theObject to item 1 of (selection as list)
tell its canvas
duplicate theObject to end of graphics
set oDuplicate to item -1 of graphics
end tell
end tell
end tell[/CODE]


All times are GMT -8. The time now is 05:00 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.