Sharing CINT powered tasks on OS X using KosmicTask

KosmicTask is an Integrated Scripting Environment for OS X that implements a plug-in architecture to provide support for more that 20 scripting languages including CINT. As such it provides a simple means of utilising the CINT interpreter on OS X.

V1.1 Preview 3 is available for download now.
Application help is available online.

The application resource browser contains a list of CINT templates that illustrate how to achieve basic task. The CINT resource document list summarises the CINT documentation and provides a usage overview.

Support for CINT is implemented as a plug-in that is installed as part of the application bundle, meaning that no additional language components need to be installed (this indeed applies to all the supported scripting languages).

KosmicTask permits tasks to be shared over the network for consumption by other users. Tasks can return simple text, formatted text, structured data and files. In the case of CINT, YAML is used to format structured results as in the following example. The task captures a number of screenshots on the host computer and returns the images to the client.

#include <iostream>
#include <unistd>

class KosmicTask {  
	public:           
  	
  	KosmicTask() { 
  		char files[1000];
  		
		for (int i = 1; i <= 5; i++) {
		
			if (i > 1) {
				strcat(files, ", ");
			}
		
			// capture screen image to file
			// files created in the current directory will be deleted when the task ends
			char file[100];
			sprintf(file, "capture-%i.png", i);
	
			char command[100];
			sprintf(command, "screencapture -t png %s", file);
	
			// execute command
			system(command);
		
			strcat(files, file);
		
			sleep(1);
	
		}
	
		// return a YAML inline format dictionary with array of filenames
		printf("--- {kosmicFile: [%s], kosmicInfo: file returned}", files);
  	}   

};
 
int main(int argc, char *argv[]) 
{
	KosmicTask kosmic;
}

If anyone has any comments or suggestions on the implementation then feel free to convey them to support@mugginsoft.com.

Thanks goes to everyone that has worked on CINT over the years.

Regards

Jonathan Mitchell
Developer
Mugginsoft LLP