Previous Book Contents Book Index Next

Inside Macintosh: Apple Guide Complete / Part 4 - Scripting Guide Files
Chapter 10 - Guide Script Command Reference / Guide Script Command Descriptions
/ Creating Coachmarks

<Define Window Coach>

You can use the <Define Window Coach> command to define a coachmark for a specific area of a window.

<Define Window Coach> coachMarkName [, targetApp] [, coachStyle]
                     [, targetWindow]
                     , windowRectangle [, rectOrigin]
A text string specifying the name of this window coach.
A four-character sequence specifying the signature of the target application or the constant FRONT to specify the frontmost application. This parameter is optional. If you omit this parameter, Apple Guide uses FRONT as the default.
A value indicating the coach style to use for the item. You specify how Apple Guide should draw the coachmark for the item using a constant or red arrow specifier:

Red arrow specifier
RedArrow(start, end)
Use the RedArrow function to draw a red arrow beginning at a location specified by start and ending at a location specified by end. The values for start and end are integers 1 through 8, where each value indicates a general location in a rectangle:
Top left1
Top center2
Top right3
Middle right4
Bottom right5
Bottom center6
Bottom left7
Middle left8
These values indicate the eight possible points for the start and end of the arrow.
The coachStyle parameter is optional. If you omit this parameter, Apple Guide uses REDCIRCLE as the default.
The window associated with this coachmark. You can specify the window's title, the constant FRONTWINDOW, or the constant DESKTOP. This parameter is optional. If omitted, Apple Guide uses FRONTWINDOW as the default.
A subrectangle that further specifies the area in which the coachmark should be drawn. You can specify a rectangle using
Rect(top, left, bottom, right). You can also use these constants to specify a specific element of a window:
You can use the constant BOOTDISK to specify a coachmark for the startup disk (use this constant only if you also specify the Finder as the target application).
A constant that gives the origin for the subrectangle. You can use one of these constants to specify the origin for the subrectangle:
The rectOrigin parameter is optional. If you omit this parameter, Apple Guide uses a default of TOPLEFT.
The <Define Window Coach> command defines a window coach. You associate a window coach with a particular panel using the <Coach Mark> command. When Apple Guide opens a panel that includes a <Coach Mark> command naming a defined window coach, Apple Guide uses the specified coach style to draw a coachmark based on the location of the coachmark, as provided in the windowRectangle parameter.

#define a window coach for an area in a window
<Define Window Coach> "RulerTabCoach", 'WAVE', REDCIRCLE, �
                      FRONTWINDOW, Rect(30, 30, 50, 50)
<Define Panel> "using the ruler"
   <Coach Mark> "RulerTabCoach"
   To set a tab in your document, 
   click the tab tool in the ruler bar.
<End Panel> 
For information on the <Coach Mark> command, see page 10-118.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
12 JUL 1996