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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!ucselx!crash!alen
  3. From: alen@crash.cts.com (Alen Shapiro)
  4. Subject: Getting the alias'd name from a drag-and-drop app?
  5. Date: 27 Aug 92 15:22:05 GMT
  6. Message-ID: <alen.714928925@crash>
  7. Summary: Need to know fast how to do this
  8. Keywords: alias drag drop help
  9. Lines: 41
  10.  
  11. Sorry to pester with this one, I know the info is in IMvol6 but
  12. the soonest I can get one of those (from the 4 bookstores I've
  13. tried here in San Diego is 6 weeks!!).
  14.  
  15. I need to take a selection of aliases from a folder and drag them onto
  16. an application (that I am writing). The app must replace each aliased
  17. files with a copy of the real file that the alias represents. I have
  18. everything working EXCEPT one small thing. I can't discover the name/
  19. location of the alias files that are dropped onto the app.
  20.  
  21. I'm using:
  22.  
  23.     CountAppFiles(&msg, &count);
  24.     
  25.     for(i=1 ; i <= count ; i++) {
  26.         GetAppFiles((short)i, &thefile);
  27.         
  28.         if((err=FSMakeFSSpec(thefile.vRefNum, (long)NULL, thefile.fName, &spec)) != noErr) {
  29.             fprintf(stderr, "FSMakeFSSpec error %hd\n", err);
  30.             exit(err);
  31.         }
  32.  
  33.         then a call to
  34.         NewAliasMinimal to get a handle to the alias
  35.         then a call to GetAliasInfo to find the name of the
  36.             aliasing file
  37.     }
  38.  
  39. Trouble is, by the time GetAppFiles sees the parmlist it seems to
  40. contain references to dereferenced alias files.
  41.  
  42. Is there a toolbox call that I should use instead of GetAppFiles
  43. that will stop it chaining down the alias chain and will cause
  44. it to deliver me the name and vRefNum of the alias itself?
  45.  
  46. --alen
  47. alen@crash.cts.com
  48.  
  49. ps I've put in an order for vol6 of IM but I'd like to continue
  50. to work meanwhile!!
  51.  
  52.