Defines a pointer to a mark token callback function. Your mark token function returns a mark token.
- macOS 10.0+
- Mac Catalyst 13.0+
- Core Services
A result code. See Result Codes. Your mark token function should return
no if it successfully supplies a mark token and
err if it fails to supply a mark token. When the Apple Event Manager gets an error result of
err after calling a mark token function, it attempts to get a mark token by calling the equivalent system marking callback function.
To get a mark token, the Apple Event Manager calls your mark token function. Like other tokens, the mark token returned can be a descriptor of any type; however, unlike other tokens, a mark token identifies the way your application will mark Apple event objects during the current session while resolving a single object specifier that specifies the key form
A mark token is valid until the Apple Event Manager either disposes of it by calling
AEDispose or returns it as the result of the
AEResolve function. If the final result of a call to
AEResolve is a mark token, the Apple event objects currently marked for that mark token are those specified by the object specifier passed to
AEResolve, and your application can proceed to do whatever the Apple event has requested. Note that your application is responsible for disposing of a final mark token with a call to
AEDispose, just as for any other final token.
If your application supports marking, it should also provide a token disposal function modeled after the token disposal function described in
OSLDispose. When the Apple Event Manager calls
AEDispose to dispose of a mark token that is not the final result of a call to
AEResolve, the subsequent call to your token disposal function lets you know that you can unmark the Apple event objects marked with that mark token. A call to
AEDispose to dispose of a mark token (which would occur if you did not provide a token disposal function) would go unnoticed.
To provide a pointer to your mark token callback function, you create a universal procedure pointer (UPP) of type
OSLGet, using the function
New. You can do so with code like the following:
If you wish to call your mark token callback function directly, you can use the
After you are finished with your mark token callback function, you can dispose of the UPP with the
Dispose function. However, if you will use the same mark token function in subsequent calls to the function
AESet or the function
AEInstall, you can reuse the same UPP, rather than dispose of it and later create a new UPP.