on rectSelectParts
-- Group selection by specifying a rectangle.
-- Select a group of parts by clicking at topLeft and bottomRight
-- of enclosing rectangle.
global selectedParts,selectedPartsCard
put empty into selectedParts
put long name of this card into selectedPartsCard
put "Click at top left..."
wait until the mouseClick
put the clickLoc into topLeft
put "Click at bottom right..."
wait until the mouseClick
put the clickLoc into botRight
put topLeft & "," & botRight into selectionRect
repeat with i = 1 to the number of buttons
if loc of button i is within selectionRect
then put "card button id " & id of button i & return after selectedParts
end repeat
repeat with i = 1 to the number of bkgnd buttons
if loc of bkgnd button i is within selectionRect
then put "bg btn id " & id of bg btn i & return after selectedParts
end repeat
repeat with i = 1 to the number of fields
if loc of field i is within selectionRect
then put "bkgnd field id " & id of field i & return after selectedParts
end repeat
repeat with i = 1 to the number of card fields
if loc of card field i is within selectionRect
then put "card field id " & id of card field i & return after selectedParts
end repeat
put the number of lines in selectedParts & " parts selected."
end rectSelectParts
This article is adapted from the Claris Tech Info database.