home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / mcl / 1352 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.5 KB  |  60 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!nassi@cambridge.apple.com
  2. From: nassi@cambridge.apple.com (Ike Nassi)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: multiple files with choose-file-dialog?
  5. Message-ID: <3130@ministry.cambridge.apple.com>
  6. Date: 2 Sep 92 22:30:51 GMT
  7. References: <9208272006.AA12235@mipsmath.math.uqam.ca>
  8. Sender: news@cambridge.apple.com
  9. Organization: Cambridge R&D
  10. Lines: 48
  11.  
  12. In article <9208272006.AA12235@mipsmath.math.uqam.ca>, cartier@math.uqam.ca
  13. (Guillaume Cartier) writes:
  14. > >Is there an easy way to get choose-file-dialog to return a list of selected 
  15. > >files? Or do I need to write  a dialog from scratch?
  16. > >
  17. > >Thanks in advance,
  18. > >
  19. > >Michael Young
  20. > >Ohio State University
  21. > The choose file dialog is not MCL's own but the standard
  22. > one from the macintosh OS. So, you will have to write your
  23. > own.
  24. > Maybe someone already did the job...
  25.  
  26. This may do it.  "(build-file-list nil)"  
  27. --- 
  28. Ike
  29.  
  30.  
  31. ;
  32. ; Return a macintosh filename from an SFGETFILE dialog box.
  33. ;
  34. (defun sf ()
  35.   (mac-namestring 
  36.    (choose-file-dialog :button-string "Select")))
  37.  
  38. ;
  39. ; Return a macintosh filename from an SFGETFILE dialog box (or nil if
  40. ; cancelled).
  41. ;
  42. (defun select-file-namestring ()
  43.   (let ((s (catch-cancel (sf))))
  44.     (if (eq s :cancel)
  45.       nil
  46.       s)))
  47.  
  48. ;
  49. ; Build a list of selected files.
  50. ;
  51. (defun build-file-list (l)
  52.   (let ((s (select-file-namestring)))
  53.     (if (eq s nil)
  54.       l
  55.       (build-file-list (cons s l)))))
  56.