Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rutgers!att!mtuxo!mtgzz!drutx!druco!jon From: jon@druco.ATT.COM (GotowJK) Newsgroups: comp.sys.mac.programmer Subject: Returning Directories with SFGetFile Keywords: SFGetFile,directory,dialog filter,CurDirStore,SFSaveDisk Message-ID: <4064@druco.ATT.COM> Date: 12 Apr 89 13:34:37 GMT Distribution: comp Organization: AT&T, Denver, CO Lines: 30 I'm writing a little program that needs to prompt the user to select a directory using SFGetFile. I once saw a DA (Virus Detective) that did just this, and have a question about how one implements a "Directory" button. Currently, I'm adding a custom "Directory" button to SFGetFile which allows the user to return the selected directory name. (ie. "Open" descends into the directory while "Directory" returns with the selected directory name). My current routine (quite a hack) installs a dialog filter proc using SFPGetFile. It looks for a hit on the "Directory" button, returning an "Open" and then a "Cancel" to the SFGetFile filter proc when it gets one. This effectively descends into the selected directory and then exits, so I can subsequently use the values in the SFSaveDisk and CurDirStore globals to find out what the selected directory was. This works, but is a bit unsightly since the user actually sees the SFGetFile dialog descending into the selected directory before quitting. How do I do this smoothly?? Is there another system global (which I know I'm not supposed to use) which points to the selected string in the SFGetFile dialog? Will the author of Virus Detective help me out on this one? I don't remember his code doing this (though I guess I could've just missed it - no, any _good_ programmer could think up a better way :-) Thanks, Jon Gotow AT&T Bell Labs - Middletown, NJ ARPANET jon@druco.att.com USENET att!druco!jon