---
title: NSCloneCommand
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsclonecommand
---

# NSCloneCommand

A command that clones one or more scriptable objects.

## Declaration

```swift
class NSCloneCommand
```

## Overview

Overview 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.

## Topics

### Working with specifiers

- [keySpecifier](foundation/nsclonecommand/keyspecifier.md)
- [setReceiversSpecifier(_:)](foundation/nsclonecommand/setreceiversspecifier(_:).md)

## Relationships

### Inherits From

- [NSScriptCommand](foundation/nsscriptcommand.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Script Commands

- [NSScriptCommand](foundation/nsscriptcommand.md)
- [NSQuitCommand](foundation/nsquitcommand.md)
- [NSSetCommand](foundation/nssetcommand.md)
- [NSMoveCommand](foundation/nsmovecommand.md)
- [NSCreateCommand](foundation/nscreatecommand.md)
- [NSDeleteCommand](foundation/nsdeletecommand.md)
- [NSExistsCommand](foundation/nsexistscommand.md)
- [NSGetCommand](foundation/nsgetcommand.md)
- [NSCountCommand](foundation/nscountcommand.md)
- [NSCloseCommand](foundation/nsclosecommand.md)
