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

Mac Open file dialog



 >To: info-mcl@ministry.cambridge.apple.com
 >Newsgroups: comp.lang.lisp.mcl
 >From: abegel@media.mit.edu (Andrew Begel)
 >Subject: Mac Open file dialog
 >Sender: news@dizzy.media.mit.edu (USENET News System)
 >Organization: MIT Media Laboratory
 >Date: Fri, 22 Apr 1994 00:08:35 GMT
 >
 >I have a slight problem. In the docs for (open-file-dialog) it says that
 >you can include a :mac-file-type parameter that will take a 4 char
 >string (like "lisp", or "fasl") and restrict the directory entries in the open file dialog to those types. Has anyone ever used this feature? I've tried,
 >and instead of showing "lisp" files (say) it just shows no files except for
 >directories.
 >
 >Can anyone tell me the syntax on how to use this command? The docs are wrong in the
 >MCL 2.0 manual.

In the MCL 2.0 manual, page 327, this is documented as "an os-type parameter
or a list of os-type parameters". Basically, instead of passing a string,
pass a symbol:

(choose-file-dialog  :mac-file-type :|FASL|)

Note that I use a keyword (prefix with :) to avoid package problems.
I also use vertical bars "|" because these operations are
case-sensitive, and symbols generally aren't.

Note that typical MCL source files have a mac-file-type of TEXT, not
"lisp". The "lisp" is the pathname's type, not the Finder type (which
you can use ResEdit to fiddle with).

? (choose-file-dialog  :mac-file-type :|TEXT|)
#P"lug nuts:Desktop Folder:frimmox.lisp"
? (pathname-type #P"lug nuts:Desktop Folder:frimmox.lisp")
"lisp"
? (mac-file-type #P"lug nuts:Desktop Folder:frimmox.lisp")
:TEXT