Ptr					appSigStr, docStr;
RunApps(void){	OSErr 				err = noErr;	int 				i;	Ptr					appSigStr, docStr;		StringPtr			relAppPath;	OSType 				appSig = 0x00000000;	FSSpec 				app, doc;	ProcessSerialNumber	psn;	StringPtr			pdocName;	unsigned short 		launchFileFlags, launchControlFlags;	Boolean 			running = nil;	LaunchParamBlockRec	launchPB;		for (i = 0; i < gControls->cfg->numRunApps; i++)	{			// convert str to ulong		HLock(gControls->cfg->apps[i].targetApp);#if 0		appSigStr = *(gControls->cfg->apps[i].targetApp);		UNIFY_CHAR_CODE(appSig, *(appSigStr), *(appSigStr+1), *(appSigStr+2), *(appSigStr+3));		err =  FindAppUsingSig(appSig, &app, &running, &psn);#endif		relAppPath = CToPascal(*(gControls->cfg->apps[i].targetApp));		err = FSMakeFSSpec(gControls->opt->vRefNum, gControls->opt->dirID, relAppPath, &app);		HUnlock(gControls->cfg->apps[i].targetApp);		if (err != noErr)			continue;				// if doc supplied		HLock(gControls->cfg->apps[i].targetDoc);		docStr = *(gControls->cfg->apps[i].targetDoc);		if ( gControls->cfg->apps[i].targetDoc && docStr && *docStr )		{				// qualify and create an FSSpec to it ensuring it exists			pdocName = CToPascal(docStr);			if (pdocName)			{				err = FSMakeFSSpec(gControls->opt->vRefNum, gControls->opt->dirID, pdocName, &doc);							// launch app using doc				if (err == noErr)				{					launchFileFlags = NULL;					launchControlFlags = launchContinue + launchNoFileFlags + launchUseMinimum;					LaunchAppOpeningDoc(running, &app, &psn, &doc, 										launchFileFlags, launchControlFlags);				}			}			if (pdocName)				DisposePtr((Ptr)pdocName);		}		// else if doc not supplied		else		{			// launch app										launchPB.launchAppSpec = &app;			launchPB.launchAppParameters = NULL;			launchPB.launchBlockID = extendedBlock;			launchPB.launchEPBLength = extendedBlockLen;			launchPB.launchFileFlags = NULL;			launchPB.launchControlFlags = launchContinue + launchNoFileFlags + launchUseMinimum;			err = LaunchApplication( &launchPB );					}		HUnlock(gControls->cfg->apps[i].targetDoc);				if (relAppPath)			DisposePtr((Ptr) relAppPath);	}		return;}