Your object accessor function either finds elements or properties of an Apple event object.
- macOS 10.0+
- Mac Catalyst 13.0+
- Core Services
A pointer to a descriptor that specifies the container of the desired Apple event object or objects. See
The key form specified by the object specifier being resolved. Constants for key form are described in Key Form and Descriptor Type Object Specifier Constants. See
A pointer to a descriptor containing the key data specified by the object specifier being resolved. See
A pointer to a descriptor where your object accessor routine stores a descriptor that identifies the found object. See
A reference constant. The Apple Event Manager passes this value to your object accessor function each time it calls it. The reference constant may have a value of 0.
A result code. See Result Codes. Your object accessor function should return
no if it successfully located the requested object and
err if it could not locate the object. When the Apple Event Manager receives the result code
err after calling an object accessor function, it attempts to use other methods of locating the requested objects, such as calling an equivalent system object accessor function.
To resolve an object specifier, your application calls the
AEResolve in turn calls application-defined object accessor functions to locate specific Apple event objects and properties in the application’s data structures. Your application provides one or more object accessor functions that can locate all the element classes and properties it supports.
Each object accessor function provided by your application should either find elements or properties of an Apple event object. The
AEResolve function uses the object class ID of the specified Apple event object and the descriptor type of the token that identifies the object’s container to determine which object accessor function to call. To install an object accessor function, use the
To provide a pointer to your object accessor callback function, you create a universal procedure pointer (UPP) of type
OSLAccessor, using the function
New. You can do so with code like the following:
You can then pass the UPP
My as a parameter to any function that installs or removes an object accessor, such as
AEInstall. If your application installs the same object accessor to handle more than one kind of object class or property of an Apple event, you can use the same UPP to install the accessor multiple times.
If you wish to call your object accessor callback function directly, you can use the
After you are finished with an object accessor callback function, and have removed it with the
AERemove function, you can dispose of the UPP with the
Dispose function. However, don’t dispose of the UPP if any remaining accessor function uses it or if you plan to install the accessor function again.