Wednesday, February 3, 2010

How do i run an application with chipmunk basic for mac?

if i have chipmunk basic. is there a code that will run or open an application program when i save the .bas file and open it?How do i run an application with chipmunk basic for mac?
Luckily the answer is very simple. If you have put the Chipmunk Basic App in /Applications and have put the 'basic' executable in /usr/bin, then double clicking any xxx.bas file will cause chipmunk to execute that BASIC program.





If you want the BASIC program to execute an Apple app then you use the 'sys' command. For example a program to start the calculator could be:





sys (';open /Applications/Calculator.app';)


exit





I saved those two lines in ';calc.bas';





Now I can double click on ';calc.bas'; in the finder or in an xterm (or terminal) I can type ';basic calc.bas';. Both methods will start the calculator.





Hope this helps :)

No comments:

Post a Comment