I don’t think you can do it directly but it is possible to launch ZBrush from a separate executable, something along the lines of:
#include <windows.h>
static const char *zbrushFolder = “C:\Program Files (x86)\Pixologic\ZBrush 4R6”;
static const char *zbrushExe = “zbrush.exe”;
static const char *scriptPath = “C:\Users\Desktop\MyZScript.txt”;
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
ShellExecute(NULL, “open”, zbrushExe, scriptPath, zbrushFolder, SW_MINIMIZE );
return 0;
}
However, note that only one zscript/plugin can be active at a time, so if your zscript calls someting like UV Mapper control passes to UV Mapper and no more commands will run in your zscript.