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 9 - Recording Apple Events / What to Record


Recording the Selection of Nontext Objects

The selection of nontext objects differs from the selection of text objects mainly in the way a recordable application specifies the objects. For example, if the user is working in a table or spreadsheet and selects row 5, column 3, your application can send a Select event with this direct parameter:
KeywordDescriptor typeData
keyDirectObjecttypeObjectSpecifier(see indented record)
keyAEDesiredClass typeType cRow
keyAEContainer typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cColumn
keyAEContainer typeNull No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 3
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 5

When recording a range of cells, use a range of rows through a range of columns.

For example, if the user selects row 5 column 3 through row 6 column 4, specify columns 3 through 4 of rows 5 through 6 by sending a Select event with this direct parameter:
KeywordDescriptor typeData
keyDirectObjecttypeObjectSpecifier(see indented record)
keyAEDesiredClass typeType cRow
keyAEContainer typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cColumn
keyAEContainer typeNull No data
keyAEKeyForm typeEnumerated formRange
keyAEKeyData typeRangeDescriptor (see indented record)
keyAERangeStart typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cColumn
keyAEContainer typeCurrentContainer No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 3
keyAERangeStop typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cColumn
keyAEContainer typeCurrentContainer No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 4
keyAEKeyForm typeEnumerated formRange
keyAEKeyData typeRangeDescriptor (see indented record)
keyAERangeStart typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cRow
keyAEContainer typeCurrentContainer No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 5
keyAERangeStop typeObjectSpecifier (see indented record)
keyAEDesiredClass typeType cRow
keyAEContainer typeCurrentContainer No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeLongInteger 6

In some drawing and layout applications, users are used to dealing with insertion points at specific locations rather than relative to other objects. For example, setting an insertion point in a recordable drawing application might cause the application to send itself a Select event that places the insertion location at (235, 330)--that is, the location defined by a vertical coordinate of 235 and a horizontal coordinate of 330. A Select event that does this could have this direct parameter:
KeywordDescriptor typeData
keyDirectObjecttypeObjectSpecifier(see indented record)
keyAEDesiredClass typeType cInsertionLocation
keyAEContainer typeNull No data
keyAEKeyForm typeEnumerated formAbsolutePosition
keyAEKeyData typeAEList (see indented record)
typeLongInteger 235
typeLongInteger 330

Notice that the key data corresponds to an application's extension of the standard interpretation of key form formAbsolutePosition.

To set a selection that consists of noncontiguous objects, an application should send events that correspond to statements like these:

select {\xA8
   row 5 thru 6 of column 3 thru 4, \xA8
   row 22 of column 6}
select {circle 2, rectangle 12, text frame 2}
select {file "Guidelines", file "Test Results"} 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996