home *** CD-ROM | disk | FTP | other *** search
- 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
- From: nassi@cambridge.apple.com (Ike Nassi)
- Newsgroups: comp.lang.lisp.mcl
- Subject: Re: multiple files with choose-file-dialog?
- Message-ID: <3130@ministry.cambridge.apple.com>
- Date: 2 Sep 92 22:30:51 GMT
- References: <9208272006.AA12235@mipsmath.math.uqam.ca>
- Sender: news@cambridge.apple.com
- Organization: Cambridge R&D
- Lines: 48
-
- 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)))))
-