Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!iuvax!purdue!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: adding a document to the launch of an application? Summary: Corrects previous mistake Message-ID: <5877@umd5.umd.edu> Date: 5 Jan 90 22:34:22 GMT References: <1085@crash.cts.com> <5872@umd5.umd.edu> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 66 In article <5872@umd5.umd.edu> zben@umd5.umd.edu (Ben Cranston) blathers: > One of the three words in the APPL resource is a link to the BNDL resource, > which then has links to the ICN# and FREF resources. I must have been high on fatigue poisons while writing that. I meant that the third word of the creator-ID resource contains the link to the bundle. Looks like all you have to do is open a WD on the directory ID in the APPL resource, then set that as the current volume, then do a Launch on the name in the APPL resource. The following information on how to find the ICON is included here for reference: Desktop File Notes: The APPL resource contains triples of creator-ID, directory number, and string filename for each application present on the desktop's volume. For example, MacWrite's creator-ID is MACA. Somewhere in the APPL resource there will be a record: MACA 20 MacWrite 5.01 This tells the finder to SetWD to a WD on directory ID 20 and then Launch MacWrite 5.01 in order to execute the application. The desktop file also contains a resource with the creator-ID as its resource ID (the resource number is always zero). The first four bytes seem to be constant (77231199?) but the last two bytes contain a link to the Finder's copy of the application's bundle resource. For example: MACA(0) 7723 1199 109D w#DoDu ---- Hexadecimal 109D is decimal 4253. Sure enough, there is a bundle resource with that number, that is a (relocated) copy of MacWrite's bundle: BNDL(4253) ICN# 1 7453 2 23840 3 15699 4 12586 FREF 1 28330 2 9671 3 29598 4 32610 These are the relocated ICN# and FREF resources as they appear in the desktop file. For example: FREF(9671) WORD 2 This says a document of creator-ID MACA and file type WORD should appear as relative icon number two. Tracking back through the bundle, we find that the appropriate icon is stored in ICN# 23840 in the desktop file. Gee, thanks for mentioning it. I didn't even KNOW there was an APPL resource till you asked about it! -- Sig DS.L ('ZBen') ; Ben Cranston * Network Infrastructures Group, Computer Science Center * University of Maryland at College Park * of Ulm