Is there a way of wating for a CMD command without blocking the entire panel? For ex:
Helper:
const WshShell = new ActiveXObject('WScript.Shell');
function _q(value) {
return '"' + value + '"';
}
function _runHidden() {
try {
WshShell.Run([...arguments].map((arg) => {return _q(arg);}).join(' '), 0, true);
return true;
} catch (e) {
return false;
}
}
Main file:
....
_runHidden(streaming_extractor_music.bat, path, essentiaJSON, essentiaPath);
... do someting with output json
Bat file:
@ECHO OFF
REM Helper to execute essentia.exe (%3) on input (%1) and save output to file (%2)
REM Retrieves LRA data as json
SET essPath=%3
%essPath% %1 %2
So when running the bat file, the panel gets blocked. But setting WshShell.Run last arg to false to not wait for termination does not inform the process when it ends.... I was hoping to get somewhat a promise functionality without luck.
Is there a better way than checking for an output file every 100 ms with an interval func or something like that? (or maybe I'm missing another approach to it)