Serial communIcation from OS X app to Arduino Mega
One problem is here:


  // Read Serial input:
  while (Serial.available() &gt; 0) {
    int inChar = Serial.read();

    if (inChar != '\n') {
      inString += (char)inChar;
      Serial.read();
    }


Your Serial.available() call guarantees that you have one byte of serial input, but you are attempting to read two of them if the first one is not a newline. This is not valid.

How to process incoming serial data without blocking