; file: psplot_end.idl = close two-device loop screen/PostScript
; last: Sep  7 2010 

  if (deviceloop eq 1) then begin
     print,' patience - second pass writing file: ',psfilename
  end

  if (deviceloop gt 1) then begin
    device,/close
    set_plot,screentype_old

    ; bang-bang IDL params back to IDL defaults
    @psplot_reset.idl

    ; print pacifier 
    print,' wrote file: ',psfilename

    ; change IDL plot label into filename
    spawn,'cat '+psfilename+$
      '| sed "s|Graphics produced by IDL|'+psfilename+$
      '|" >  temp.ps; mv temp.ps '+psfilename
  endif

; end of two-device loop
endfor

