---
title: "AEStreamOpenRecord(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1447141-aestreamopenrecord
---

# AEStreamOpenRecord(_:_:)

Marks the beginning of an Apple event record in an AEStreamRef.

## Declaration

```swift
func AEStreamOpenRecord(_ ref: AEStreamRef!, _ newType: DescType) -> OSStatus
```

## Parameters

- `ref`: An doc://com.apple.documentation/documentation/coreservices/aestreamref containing the stream data.
- `newType`: A type code for the new record you are adding to the stream. This value can be typeAERecord or any other appropriate value. See doc://com.apple.documentation/documentation/coreservices/desctype.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion This routine marks the beginning of a sequence of zero or more keyword/descriptor definitions that you use to build an AERecord structure. You must balance each call to this method with a corresponding call to AEStreamCloseRecord(_:).  For information on adding keyword/descriptor data to the record, see the AEStreamOpenKeyDesc(_:_:_:), AEStreamWriteKey(_:_:), and AEStreamWriteKeyDesc(_:_:_:_:_:) routines.

## See Also

### Creating Apple Event Structures Using Streams

- [AEStreamClose(_:_:)](coreservices/1449821-aestreamclose.md)
- [AEStreamCloseDesc(_:)](coreservices/1449272-aestreamclosedesc.md)
- [AEStreamCloseList(_:)](coreservices/1448185-aestreamcloselist.md)
- [AEStreamCloseRecord(_:)](coreservices/1449522-aestreamcloserecord.md)
- [AEStreamCreateEvent(_:_:_:_:_:_:_:)](coreservices/1446562-aestreamcreateevent.md)
- [AEStreamOpen()](coreservices/1447732-aestreamopen.md)
- [AEStreamOpenDesc(_:_:)](coreservices/1446544-aestreamopendesc.md)
- [AEStreamOpenEvent(_:)](coreservices/1445366-aestreamopenevent.md)
- [AEStreamOpenKeyDesc(_:_:_:)](coreservices/1442897-aestreamopenkeydesc.md)
- [AEStreamOpenList(_:)](coreservices/1448594-aestreamopenlist.md)
- [AEStreamOptionalParam(_:_:)](coreservices/1444481-aestreamoptionalparam.md)
- [AEStreamSetRecordType(_:_:)](coreservices/1447704-aestreamsetrecordtype.md)
- [AEStreamWriteAEDesc(_:_:)](coreservices/1448487-aestreamwriteaedesc.md)
- [AEStreamWriteData(_:_:_:)](coreservices/1442610-aestreamwritedata.md)
- [AEStreamWriteDesc(_:_:_:_:)](coreservices/1450387-aestreamwritedesc.md)
- [AEStreamWriteKey(_:_:)](coreservices/1448750-aestreamwritekey.md)
- [AEStreamWriteKeyDesc(_:_:_:_:_:)](coreservices/1442568-aestreamwritekeydesc.md)
