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

# matchesAppleEventCode(_:)

Returns a Boolean value indicating whether a primary or secondary Apple event code in the receiver matches the passed code.

## Declaration

```swift
func matchesAppleEventCode(_ appleEventCode: FourCharCode) -> Bool
```

## Parameters

- `appleEventCode`: An Apple event code to compare against the receiver’s primary or secondary codes.

## Return Value

Return Value true if the receiver’s primary four-character Apple event code or any of its secondary codes (its synonyms) matches code; otherwise, false.

## See Also

### Getting and comparing Apple event codes

- [appleEventCode](foundation/nsscriptclassdescription/appleeventcode.md)
- [appleEventCode(forKey:)](foundation/nsscriptclassdescription/appleeventcode(forkey:).md)
