Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 6 - Resolving and Creating Object Specifier Records / Reference to Resolving and Creating Object Specifier Records
Application-Defined Routines / Object Callback Functions


MyGetMarkToken

If your application supports marking, you must provide one mark token function. A mark token function returns a mark token.

FUNCTION MyGetMarkToken (containerToken: AEDesc; 
                         containerClass: DescType; 
                         VAR result: AEDesc): OSErr;
containerToken
The Apple event object that contains the elements to be marked with the mark token.
containerClass
The object class of the container that contains the objects to be marked.
result
Your mark token function should return a mark token in this parameter.
DESCRIPTION
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 record 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 record that specifies the key form formTest.

A mark token is valid until the Apple Event Manager either disposes of it (by calling AEDisposeToken) 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 record 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 AEDisposeToken, 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 on page 6-111. When the Apple Event Manager calls AEDisposeToken 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 AEDisposeDesc to dispose of a mark token (which would occur if you did not provide a token disposal function) would go unnoticed.

RESULT CODES
noErr0No error occurred
errAEEventNotHandled-1708The mark token function is unable to return a mark token; if the Apple Event Manager gets this result, it attempts to get a mark token by calling the equivalent system marking callback function
SEE ALSO
For more information, see "Writing Marking Callback Functions," which begins on page 6-62.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996