home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!cs.utexas.edu!torn!cunews!nrcnet0!bnrgate!bmers95!usenet
- From: ross@bnr.ca (Ross Brown)
- Subject: Re: Getting the alias'd name from a drag-and-drop app?
- Message-ID: <1992Aug28.152653.10332@bmers95.bnr.ca>
- Sender: usenet@bmers95.bnr.ca
- Organization: Bell-Northern Research
- References: <alen.714928925@crash>
- Date: Fri, 28 Aug 92 15:26:53 GMT
- Lines: 46
-
- In article <alen.714928925@crash> alen@crash.cts.com (Alen Shapiro) writes:
- >[stuff deleted]
- >Is there a toolbox call that I should use instead of GetAppFiles
- >that will stop it chaining down the alias chain and will cause
- >it to deliver me the name and vRefNum of the alias itself?
-
- No. The alternative ('odoc' Apple event handling) would give you the same
- thing. The Finder and Standard File package always, always (see *EXCEPTION*
- below) resolve aliases before handing files to your application. This is good
- for at least two reasons: one, it allows most System-7-unaware applications to
- continue to work under System 7 (since document aliases have the same creator
- and type as the originals, how could the application be expected to know the
- difference?); and two, it forces the vast majority of System-7-aware
- applications to behave consistently in their handling of aliases, to the relief
- of users everywhere.
-
- In short, a drag-and-drop application can not do what you propose. You might
- decide to crawl the file system to find alias files directly; for example, you
- could ask the user to pick a folder, then present a list of alias files in that
- folder for the user to choose from. Or, as an *EXCEPTION* to the Standard File
- package's usual behavior, which you would have to explain carefully to your
- user, you could override its handling of aliases using CustomGetFile and a
- dialog hook proc like this:
-
- pascal short DefeatAliasDialogHook( short item, DialogPtr theDialog, Ptr
- myDataPtr )
- {
- #pragma unused( theDialog, myDataPtr )
- switch( item )
- {
- case sfHookOpenAlias:
- return sfItemOpenButton;
- default:
- return item;
- }
- }
-
- This would give your application the alias's FSSpec, as you want it. Hope this
- helps!
-
- W. Ross Brown | from Brown's Bestiary of the Macintosh:
- Advisor, Telemanagement Svcs. | PBCatMoof: A purring system trap shaped like
- Bell-Northern Research Ltd. | a dog with cow spots and a 3-hr. battery life.
- Ottawa, Ontario, Canada | ----------------------------------------------
- ross@bnr.ca | Any opinion expressed is mine, not BNR's.
-
-