title: Node.js open terminal window (Electron on Mac OS)
body: <p>I have an electron application that I would like to open a terminal (cmd window), and run a script within the terminal on the click of a button. I have tried a few options such as </p>
  
  <pre><code>var spawn = require("child_process").spawn;
  </code></pre>
  
  <p>However this only runs within the application and doesn't launch an external terminal window. I have also tried </p>
  
  <pre><code>var osascript = require('osascript');
  osascript -e 'tell application "Terminal" to do script "./hello.py'
  </code></pre>
  
  <p>However this simply give me the error 'SyntaxError: Unexpected string' and doesn't launch an external terminal.</p>
  
  <p>If anyone has the solution please help me out, as I've been struggling for a while.</p>
  
  <p>Thanks </p>