home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14661 < prev    next >
Encoding:
Text File  |  1992-08-29  |  2.5 KB  |  58 lines

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