---
title: NSScriptKeyValueCoding
framework: objectivec
role: collectionGroup
role_heading: API Collection
path: objectivec/nsscriptkeyvaluecoding
---

# NSScriptKeyValueCoding

A collection of methods that provide additional capabilities for working with key-value coding.

## Overview

Overview Cocoa scripting takes advantage of key-value coding to get and set information in scriptable objects. The methods in this category provide additional capabilities for working with key-value coding, including getting and setting key values by index in multi-value keys and coercing (or converting) a key value. Additional methods allow the implementer of a scriptable container class to provide fast access to elements that are being referenced by name and unique ID. Because Cocoa scripting invokes setValue(_:forKey:) and mutableArrayValue(forKey:), changes to model objects made by AppleScript scripts are observable using automatic key-value observing. note: In OS X 10.3 and earlier, Cocoa scripting did not invoke setValue(_:forKey:) or mutableArrayValue(forKey:), so automatic key-value observing notification was not always done for model object changes caused by scripts. Starting in macOS 10.4, for backward binary compatibility, if it is overridden, Cocoa invokes the now-deprecated method takeValue(_:forKey:) instead of setValue(_:forKey:).

## Topics

### Indexed access

- [insertValue(_:at:inPropertyWithKey:)](objectivec/nsobject-swift.class/insertvalue(_:at:inpropertywithkey:).md)
- [removeValue(at:fromPropertyWithKey:)](objectivec/nsobject-swift.class/removevalue(at:frompropertywithkey:).md)
- [replaceValue(at:inPropertyWithKey:withValue:)](objectivec/nsobject-swift.class/replacevalue(at:inpropertywithkey:withvalue:).md)
- [value(at:inPropertyWithKey:)](objectivec/nsobject-swift.class/value(at:inpropertywithkey:).md)

### Access by name, key, or ID

- [insertValue(_:inPropertyWithKey:)](objectivec/nsobject-swift.class/insertvalue(_:inpropertywithkey:).md)
- [value(withName:inPropertyWithKey:)](objectivec/nsobject-swift.class/value(withname:inpropertywithkey:).md)
- [value(withUniqueID:inPropertyWithKey:)](objectivec/nsobject-swift.class/value(withuniqueid:inpropertywithkey:).md)

### Coercion

- [coerceValue(_:forKey:)](objectivec/nsobject-swift.class/coercevalue(_:forkey:).md)

### Constants

- [NSScriptKeyValueCoding Exception Names](objectivec/nsscriptkeyvaluecoding-exception-names.md)

## See Also

### Related Documentation

- [Cocoa Scripting Guide](apple-archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html.md)
- [Key-Value Coding Programming Guide](apple-archive/documentation/Cocoa/Conceptual/KeyValueCoding.md)

### Key-Value Coding

- [NSKeyValueBindingCreation](objectivec/nskeyvaluebindingcreation.md)
- [NSKeyValueCoding](objectivec/nskeyvaluecoding.md)
- [NSScriptKeyValueCoding Exception Names](objectivec/nsscriptkeyvaluecoding-exception-names.md)
