It is possible to access Unix Terminal commands (command line) on a Mac (OSX) through Processing. This example uses the say command and then open to open two applications. Note that parameters are in a String array (String[]) can can be changed with standard array calls.
NOTE: This example assumes you have google earth and Arduino installed in the applications folder. If you are having trouble, try full paths to applications you are opening.
Based on processing thread:
http://processing.org/discourse/yabb2/YaBB.pl?num=1237204442
Sample Code
// OSX command line in Processing
// based upon
// http://processing.org/discourse/yabb2/YaBB.pl?num=1237204442
// see also
// http://hintsforums.macworld.com/archive/index.php/t-2597.html
// steve daniels, hex705, jan 2011.
void setup() {
size(300,300);
}
void draw() {
// nothing here -- click mouse to make it all happen
}
void mousePressed() {
// on command line--> say "Hello World"
String[] speak = {
"say", "opening google earth"
};
exec(speak);
String[] openApp = {
"open", "-a", "google earth"
};
exec(openApp);
// opens another App
openApp[2] = "Arduino";
exec(openApp);
}