on selectBkgnd clearSelectionFlag
-- Group selection of backgrounds.
-- This handler adds the current background to the
-- currently selected backgrounds or clears the list
-- of currently selected bkgnds:
-- selectBkgnd clear -- any non-empty parameter clears
-- previous selection
-- selectBkgnd -- adds current bkgnd to the list of
-- selected bkgnds
global selectedBkgnds
if clearSelectionFlag is not empty
then put empty into selectedBkgnds
else -- get around bug in long id of bkgnd
get "bkgnd id " & id of this bkgnd & " of " & name of this stack
put it & return after selectedBkgnds
end if
end selectBkgnd
This article is adapted from the Claris Tech Info database.