---
title: "setReceiversSpecifier(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nssetcommand/setreceiversspecifier(_:)"
---

# setReceiversSpecifier(_:)

Sets the receiver’s object specifier.

## Declaration

```swift
func setReceiversSpecifier(_ receiversRef: NSScriptObjectSpecifier?)
```

## Parameters

- `receiversRef`: The receiver’s object specifier.

## Discussion

Discussion When the command is executed, it sets attributes or relationships in the objects specified by receiversRef. This method overrides receiversSpecifier 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 color of the third rectangle, the receiver specifier is the third rectangle, while the key specifier is the color.

## See Also

### Working with specifiers

- [keySpecifier](foundation/nssetcommand/keyspecifier.md)
