---
title: "setValue(_:forOutputKey:)"
framework: quartz
role: symbol
role_heading: Instance Method
path: "quartz/qcplugin/setvalue(_:foroutputkey:)"
---

# setValue(_:forOutputKey:)

Sets the value of an output port.

## Declaration

```swift
func setValue(_ value: Any!, forOutputKey key: String!) -> Bool
```

## Parameters

- `value`: The value to associate with the specified key.
- `key`: The key associated with the output port whose value you want to set.

## Return Value

Return Value true if successful; false  if called outside of the execute(_:atTime:withArguments:) method.

## Discussion

Discussion You call this method from within your execute(_:atTime:withArguments:) method to set the output values of your custom patch.

## See Also

### Getting and Setting Port Values

- [didValue(forInputKeyChange:)](quartz/qcplugin/didvalue(forinputkeychange:).md)
- [value(forInputKey:)](quartz/qcplugin/value(forinputkey:).md)
