#include <stdio.h>#include <stdlib.h>#include	<String.h>#include	<ASRegistry.h>#include	"ScriptEvents.h"#define	kAppleScriptResourceID		128void			main (void);									// function prototypeschar* 			doTheBeautify(char* old_text);/***************************************************************************************************		Initialize everything and do the Main Event Loop ***************************************************************************************************/void main (void){	OSErr   		myErr;	AEDescList		reply;	char 			*old_text;	char 			*new_text;			/***************************************************************************************************				start get_data ***************************************************************************************************/	printf ("\n ееееееееее getData () ееееееееееееееееее\n");	myErr = CallEmbeddedAS ("get_data", NULL, &reply);	if (myErr == noErr) {		OSErr   	stringErr;		UInt32		minBufferSize;		AEDescList	theStringsList;		SInt16		num1;			SInt16		num2;			SInt16		num3;		DescType	firstType;		DescType	secondType;		DescType	thirdType;		stringErr = GetNthScptRtnVal (&reply, 1, typeAEList, NULL, &theStringsList, 0, NULL);		myErr = 	GetNthScptRtnVal (&reply, 2, typeSInt16, &firstType, &num1, sizeof (SInt16), NULL);		if (num1 == -1)			exit(0);			myErr = 	GetNthScptRtnVal (&reply, 3, typeSInt16, &secondType, &num2, sizeof (SInt16), NULL);		myErr = 	GetNthScptRtnVal (&reply, 4, typeSInt16, &thirdType, &num3, sizeof (SInt16), NULL);		myErr =	GetSizeOfScptRtnStringArray (&theStringsList, &minBufferSize, NULL);		printf ("\nеееее BufferSize is %li еееее\nargs are: %i\t%i\t%i\n", 			(UInt32) minBufferSize, num1, num2, num3);		if (stringErr == noErr) {			char 		*temp_char;			char		*stringBuffer;			stringBuffer = NewPtr (minBufferSize);						if (stringBuffer != NULL) {				myErr = GetScptRtnValStringArray (&theStringsList, 													NULL, 													0,													0,													NULL,													stringBuffer, 													minBufferSize, 													NULL);				AEDisposeDesc (&theStringsList);			// finished with returned parameters; dispose				temp_char = strchr(stringBuffer, '\r');				while(temp_char != NULL) {					*temp_char = '\n';					temp_char = strchr(stringBuffer, '\r');				}													printf ("\n    String (%li chars) is: \n------------------\n╥\n%s\n╙\n------------------\n", (UInt32) strlen (stringBuffer), stringBuffer);			}						old_text = stringBuffer;		}		//		DumpASReturnedValues (&reply);					// display contents of the parameters returned from our AppleScript		AEDisposeDesc (&reply);							// done with returned parameters; dispose	}	/***************************************************************************************************				end get_data ***************************************************************************************************/	printf ("end get/start Beautify\n");	new_text = doTheBeautify(old_text);	printf ("end Beautfiy/start set\n");/***************************************************************************************************				start set_data ***************************************************************************************************/	printf ("\nееееееееее setData ееееееееееееееееее\n");	myErr = AddEmbeddedASParm (typeChar, "Green eggs and ham.");	// add {"Green eggs and ham."} parameter	if (myErr == noErr) {			printf("i'm in\n");		myErr = CallEmbeddedAS (new_text, NULL, NULL);		if (myErr == noErr) {			printf("i'm in\n");		} else {			ClearEmbeddedASParms ();							// we had an error adding parameters; abort, clear parameters		}	}/***************************************************************************************************				end set_data ***************************************************************************************************/	printf ("end set\n");	ClearEmbeddedASWorld ();}// test thing to make sure i am changing something..// this is where the java function call would be insertedchar* doTheBeautify(char* input_text) {	char* temp_char;	printf("%s\n", input_text);	temp_char = strchr(input_text, 'e');	while(temp_char != NULL) {		*temp_char = '-';		temp_char = strchr(input_text, 'e');		printf("%s\n", input_text);	}							return input_text;}