pascal void MoreAEDisposeDesc(AEDesc *desc){ OSStatus junk; MoreAssertQ(desc != nil); junk = AEDisposeDesc(desc); MoreAssertQ(junk == noErr); MoreAENullDesc(desc); }
//******************************************************************************** // A simple wrapper around CreateObjSpecifier which creates // an object specifier using formName and the name in pKeyData. pascal OSStatus MoreAEOCreateObjSpecifierFormName(DescType pDesiredClass, const AEDesc *pContainer, ConstStr255Param pKeyData, Boolean pDisposeInputs, AEDesc *pObjSpecifier) { OSStatus anErr; AEDesc keyDesc; assert(pContainer != NULL); assert(pKeyData != NULL); assert(pObjSpecifier != NULL); MoreAENullDesc(&keyDesc); anErr = AECreateDesc(typeText, &pKeyData[1], pKeyData[0], &keyDesc); if (noErr == anErr) { anErr = CreateObjSpecifier(pDesiredClass, (AEDesc *) pContainer, formName, &keyDesc, pDisposeInputs, pObjSpecifier); } MoreAEDisposeDesc(&keyDesc); return anErr; }//end MoreAEOCreateObjSpecifierFormName
//******************************************************************************** // A simple wrapper around CreateObjSpecifier which creates // an object specifier using formAbsolutePosition, a key of // typeLongInteger (rather than typeAbsoluteOrdinal) and the // position index in pKeyData. pascal OSStatus MoreAEOCreateObjSpecifierFormAbsPos(DescType pDesiredClass, const AEDesc *pContainer, SInt32 pKeyData, SInt32 pDisposeInputs, AEDesc *pObjSpecifier) { OSStatus anErr; AEDesc keyDesc; assert(pContainer != NULL); assert(pObjSpecifier != NULL); MoreAENullDesc(&keyDesc); anErr = AECreateDesc(typeLongInteger, &pKeyData, sizeof(SInt32), &keyDesc); if (noErr == anErr) { anErr = CreateObjSpecifier(pDesiredClass, (AEDesc *) pContainer, formAbsolutePosition, &keyDesc, pDisposeInputs, pObjSpecifier); } MoreAEDisposeDesc(&keyDesc); return anErr; }//end MoreAEOCreateObjSpecifierFormAbsPos