- Inside Macintosh: Programmer's Guide to MacApp / Part 1 - MacApp Theory and Architecture
- Chapter 6 - Scripting
User Interaction
When your application supports Apple events, it may act as a server, providing services to a client application or script. The client has the option of setting the interaction level, and it may specify that no user interface items should be displayed. If your application wishes to interact with the user while processing an Apple event, it should call the TApplication method InteractWithUser. This method determines whether user interaction is allowed, based on information obtained from the Apple Event Manager, and returns an appropriate OSErr value:
- NoErr. Interaction is allowed and the application is in the foreground. If interaction is allowed and the application isn't in the foreground,
InteractWithUser uses the Notification Manager to bring the application to the front.
- Any other error value. Either interaction is not allowed or the application is not in the foreground (and could not be brought to the foreground).
Your application can call InteractWithUser, then call FailOSErr, passing the returned value. Any error will be handled as described in the following section.
© Apple Computer, Inc.
25 JUL 1996