[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple files with choose-file-dialog?



In article <9208272006.AA12235@mipsmath.math.uqam.ca>, cartier@math.uqam.ca
(Guillaume Cartier) writes:
> 
> >Is there an easy way to get choose-file-dialog to return a list of selected 
> >files? Or do I need to write  a dialog from scratch?
> >
> >Thanks in advance,
> >
> >Michael Young
> >Ohio State University
> 
> The choose file dialog is not MCL's own but the standard
> one from the macintosh OS. So, you will have to write your
> own.
> 
> Maybe someone already did the job...
> 

This may do it.  "(build-file-list nil)"  
--- 
Ike


;
; Return a macintosh filename from an SFGETFILE dialog box.
;
(defun sf ()
  (mac-namestring 
   (choose-file-dialog :button-string "Select")))

;
; Return a macintosh filename from an SFGETFILE dialog box (or nil if
; cancelled).
;
(defun select-file-namestring ()
  (let ((s (catch-cancel (sf))))
    (if (eq s :cancel)
      nil
      s)))

;
; Build a list of selected files.
;
(defun build-file-list (l)
  (let ((s (select-file-namestring)))
    (if (eq s nil)
      l
      (build-file-list (cons s l)))))