<pre>on doToSelectedParts layer,doWhat  toComputer  put "Show,Hide,Delete" into doWhatDomain  if doWhat is not in doWhatDomain then return "Can't do that."  put selectedParts(layer) into theSelectedParts  if theSelectedParts is empty then return "No selected parts."  ---------------------------------------------------------------------------  if layer is "card" or layer is "cd" then    repeat with x = 1 to the number of cd parts      if the id of cd part x is in theSelectedParts then        if doWhat is "Show" then show cd part x        if doWhat is "Hide" then hide cd part x        if doWhat is "Delete" then delete cd part x      end if    end repeat  end if  ---------------------------------------------------------------------------  if layer is "background" or layer is "bkgnd" or layer is "bg" then    repeat with x = 1 to the number of bg parts      if the id of bg part x is in theSelectedParts then        if doWhat is "Show" then show bg part x        if doWhat is "Hide" then hide bg part x        if doWhat is "Delete" then delete bg part x      end if    end repeat  end ifend doToSelectedParts</pre>