I'm using system.callSystem to launch a frame-cycler (djv view in my case) but I can't figure out how to launch the application without having AE hanging waiting for me to close the window.
In windows I know that you can use 'start app-path.exe' to launch a new process, but I can't seem to make it work with AE..
The code works, but waits until the viewer windows is closed.
Code: Select all
var imViewer = ((app.settings.haveSetting("test", "imviewerr")))?(app.settings.getSetting("test", "imviewerr")):"";
vpath = imViewer;
viewer = new File(vpath);
if(viewer.exists){
cmd = "cmd /c \""+escapeWin(pathToWinPath(vpath))+"\"";
system.callSystem(cmd);
}else{
viewer = File.openDialog ("Choose an image viewer (like djv view). This dialog will only appear once", "");
app.settings.saveSetting("test", "imviewerr",viewer.path+"/"+viewer.name);
}
// working call system.callSystem("cmd /c \"C:\\Program Files (x86)\\djv 0.8.2\\bin\\djv_view.exe\"");
function pathToWinPath(path){
str = path.replace(/\//, "");
str = str.replace(/\//, ":/");
str = str.replace(/%20/g, " ");
str = str.replace(/\//g, "\\");
return str;
}
function escapeWin(string){
str = string.replace(/\\/g,"\\\\");
return str
}
Thanks!