---
title: "isLocationRequiredToCreate(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsscriptclassdescription/islocationrequiredtocreate(forkey:)"
---

# isLocationRequiredToCreate(forKey:)

Returns a Boolean value indicating whether an insertion location must be specified when creating a new object in the specified to-many relationship of the receiver.

## Declaration

```swift
func isLocationRequiredToCreate(forKey toManyRelationshipKey: String) -> Bool
```

## Parameters

- `toManyRelationshipKey`: The key for the to-many relationship that may require an insertion location.

## Return Value

Return Value true if an insertion location must be specified; otherwise, false.

## Discussion

Discussion A script command object that creates a new object in a to-many relationship needs to know whether an explicitly specified insertion location is required. It can get this information from an instance of NSScriptClassDescription. For example, NSMakeCommand uses this method to determine whether or not a specific make AppleScript command must have an at parameter.

## See Also

### Getting basic information about the script class

- [className](foundation/nsscriptclassdescription/classname.md)
- [defaultSubcontainerAttributeKey](foundation/nsscriptclassdescription/defaultsubcontainerattributekey.md)
- [implementationClassName](foundation/nsscriptclassdescription/implementationclassname.md)
- [suiteName](foundation/nsscriptclassdescription/suitename.md)
