<pre>on doToMarkedCards theAction,theCriteria  if the number of marked cds = 0 then return "There are no marked cards."  toComputer  ---------------------------------------------------------------------------  if theAction is "LIST" then    repeat with x = 1 to the number of marked cds      put the short name of marked cd x into line x of markedCardsList    end repeat    return markedCardsList  end if  ---------------------------------------------------------------------------  if theAction is "PRINT" then    open printing with dialog    repeat with x = 1 to the number of marked cds      print marked cd x    end repeat    close printing    return empty  end if  ---------------------------------------------------------------------------  if theAction is "DELETE" then    repeat with x = 1 to the number of marked cds      go to marked cd x      doMenu "Delete Card"    end repeat    return empty  end if  ---------------------------------------------------------------------------  if theAction is "EXTRACT" or theAction is "COPY" then    if theAction is "EXTRACT" and the number of marked cds = the number of cds    then return "No extraction necessary."    doMenu "New Stack..."    put the long name of this stack into destination    go back    put the long name of this stack into source    repeat with x = the number of marked cds down to 1      go to marked cd x      if theAction is "EXTRACT" then doMenu "Cut Card" else doMenu "Copy Card"      go to destination      doMenu "Paste Card"      unmark this cd      go to source    end repeat    return empty  end if  ---------------------------------------------------------------------------  if theAction is "CUT" then    if theCriteria is empty then return empty    put pile(theCriteria) into destinationStack    if destinationStack is empty then      answer file "Paste cards into which stack ?" of type STAK      if it is "cancel" or it is empty then return empty      put it into destinationStack    end if    put the long name of this stack into sourceStack    delete word 1 of sourceStack    set cantAbort of stack sourceStack to true    set cantAbort of stack destinationStack to true    repeat with x = the number of marked cds down to 1      go to marked cd x of stack sourceStack      set cantDelete of this cd to false      set cantDelete of this bg to false      if the number of cds > 1 then doMenu "Cut card"      else        doMenu "Copy card"        set cantDelete of this stack to false        doMenu "Delete stack"      end if      go to last cd of stack destinationStack      doMenu "Paste card"    end repeat    if there is a stack sourceStack then      go to stack sourceStack      set cantAbort of stack sourceStack to false    end if    set cantAbort of stack destinationStack to false  end if  ---------------------------------------------------------------------------  if theAction is "UNMARK" then    if theCriteria is empty then      unmark all cds      return empty    else      put markingCriteria(theCriteria) into theCriteria      do "unmark cds where" && theCriteria && "is true"      doToMarkedCards "list"      return the result    end if  end if  ---------------------------------------------------------------------------end doToMarkedCards</pre>