---
title: "init(objectSpecifier:comparisonOperator:test:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsspecifiertest/init(objectspecifier:comparisonoperator:test:)"
---

# init(objectSpecifier:comparisonOperator:test:)

Returns a specifier test initialized to evaluate a test object against an object specified by an object specifier using a given comparison operation.

## Declaration

```swift
init(objectSpecifier obj1: NSScriptObjectSpecifier?, comparisonOperator compOp: NSSpecifierTest.TestComparisonOperation, test obj2: Any?)
```

## Parameters

- `obj1`: An object specifier.
- `compOp`: The comparison operation.
- `obj2`: The object against which to evaluate the object specified by obj1.

## Return Value

Return Value A specifier test initialized to evaluate (obj2) against an object specified by obj1 using the comparison operation compOp.

## See Also

### Related Documentation

- [Cocoa Scripting Guide](apple-archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html.md)
