Launch Application with Doc using Apple Events
Launch Application with Doc using Apple EventsavailableÛavailable4/*availableA$Launch application with doc using Apple EventsavailableN$8This short application demonstrates how to send an Apple event (Æ) to theavailable[$EFinder requesting it to open a document as if it had been double clicked.availableh$FEverything about this code is System 7 dependent, so don't even bother tryingavailableu$Eto run it under System 6. Just add MacTraps and MacTraps2 to the project.available */available !// Assumes inclusion of Ä #include <AppleEvents.h>Ä #include <Processes.h#include <Aliases.h>available›@// Constants for dealing with FinderEvents. See Chapter 8 of the Apple EventavailableÍ// Registry for more information.available˜#define kFinderSig 'FNDR'available #define kAEFinderEvents 'FNDR'attribute#define kSystemType 'MACS'available #define kAEOpenSelection 'sope'available #define keySelection 'fsel'available // Proto typesavailable void InitToolbox(void);Ål.OSErr FindAProcess(OSType, OSType, ProcessSerialNumber*);Åy