| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSScriptStandardSuiteCommands.h |
An instance of NSCloneCommand clones the specified scriptable object or objects (such as words, paragraphs, images, and so on) and inserts them in the specified location, or the default location if no location is specified. The cloned scriptable objects typically correspond to objects in the application, but aren’t required to. This command corresponds to AppleScript’s duplicate command.
NSCloneCommand is part of Cocoa’s built-in scripting support. It works automatically to support the duplicate command through key-value coding. Most applications don’t need to subclass NSCloneCommand or invoke its methods.
When an instance of NSCloneCommand is executed, it clones the specified objects by sending them copyWithZone: messages.
Returns a specifier for the object or objects to be cloned.
- (NSScriptObjectSpecifier *)keySpecifier
A specifier for the object or objects to be cloned.
For example, the specifier may indicate that a document’s third rectangle should be cloned. The returned specifier is valid only in the context of the NSCloneCommand object; for example, if you send the specifier a containerSpecifier message, the result is nil.
NSScriptStandardSuiteCommands.hSets the receiver’s object specifier;.
- (void)setReceiversSpecifier:(NSScriptObjectSpecifier *)receiversRef
The object specifier for the receiver.
When evaluated, the specifier indicates the receiver or receivers of the clone command.
This method overrides setReceiversSpecifier: in NSScriptCommand. It performs the same function as the overridden method, with a critical difference: it causes the container specifier part of the passed-in object specifier to become the receiver specifier of the command, and the key part of the passed-in object specifier to become the key specifier. If, for example, receiversRef is a specifier for the third rectangle of the first document, the receiver specifier is the first document while the key specifier is the third rectangle.
NSScriptStandardSuiteCommands.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)