<pre>on doToSelectedFields layer,doWhat,options  put "Lock,Unlock,Show,Hide,Delete,setStyle" into doWhatDomain  if doWhat is not in doWhatDomain then exit doToSelectedFields  put selectedFields(layer) into theSelectedFields  if theSelectedFields is empty then exit doToSelectedFields  ---------------------------------------------------------------------------  if layer is "card" or layer is "cd" then    repeat with x = 1 to the number of cd flds      if the id of cd fld x is in theSelectedFields then        if doWhat is "Lock" then set lockText of cd fld x to true        if doWhat is "Unlock" then set lockText of cd fld x to false        if doWhat is "Show" then show cd fld x        if doWhat is "Hide" then hide cd fld x        if doWhat is "Delete" then delete cd fld x        if doWhat is "setStyle" then set style of cd fld x to options      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 flds      if the id of bg fld x is in theSelectedFields then        if doWhat is "Lock" then set lockText of bg fld x to true        if doWhat is "Unlock" then set lockText of bg fld x to false        if doWhat is "Show" then show bg fld x        if doWhat is "Hide" then hide bg fld x        if doWhat is "Delete" then delete bg fld x        if doWhat is "setStyle" then set style of bg fld x to options      end if    end repeat  end ifend doToSelectedFields</pre>