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

# forKey(_:)

Returns the class description instance for the class type of the specified attribute or relationship.

## Declaration

```swift
func forKey(_ key: String) -> NSScriptClassDescription?
```

## Parameters

- `key`: The identifying key for an attribute or relationship of the receiver.

## Return Value

Return Value The instance of NSScriptClassDescription for the type of the attribute or relationship specified by key. Returns nil if no scriptable property corresponds to key.

## See Also

### Getting a Script Class Description

- [init(for:)](foundation/nsscriptclassdescription/init(for:).md)
- [superclass](foundation/nsscriptclassdescription/superclass.md)
