The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
reference of result of duplicate command in applescript? Thread Tools Search this Thread Display Modes
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
How do I get a reference to the new graphic?
 
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
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Action (applescript request) steve OmniFocus Extras 7 2012-01-13 08:12 AM
Key Command Reference [Shortcuts] steve OmniFocus 1 for Mac 8 2008-01-11 10:18 AM
Applescript Duplicate command: how to use it? Lutin OmniFocus Extras 6 2007-10-30 12:56 AM
how to reference the source for an OmniWeb page via AppleScript eYeToEyeRob OmniWeb General 3 2006-06-30 08:37 PM
duplicate the above row-- applescript? steve OmniOutliner 3 for Mac 2 2006-05-02 07:18 AM


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


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