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
var spawn = require("child_process").spawn;
However this only runs within the application and doesn't launch an external terminal window. I have also tried
var osascript = require('osascript');
osascript -e 'tell application "Terminal" to do script "./hello.py'
However this simply give me the error 'SyntaxError: Unexpected string' and doesn't launch an external terminal.
If anyone has the solution please help me out, as I've been struggling for a while.
Thanks