For a separate application you’d need to launch ZBrush with a zscript file using (on Windows) ShellExecute. The zscript would then need to do what you want, perhaps reading any necessary data from a file written by the external program.
Setting a save folder is tricky. You can’t do it directly, so that users pressing the File>Save button automatically get the folder you want. You’d have to have a plugin button that users used instead, which would contain a bit of creative scripting:
[VarSet, resetZFolder,0]
[If,[IGet,Preferences:Misc:Use ZFolders]==0,
[ISet,Preferences:Misc:Use ZFolders,1]
[VarSet, resetZFolder,1]
]
[VarSet,saveFolder,[FileNameResolvePath,“ZBRUSH_ZExportImport/Test.zpr”]]
[VarSet,fileName,[FileNameAsk,“ZProject(.zpr)|.ZPR||”,saveFolder,“Please Save File…”]]
[If,[StrLength,fileName],
[FileNameSetNext,fileName]
[IPress,File:Save As]
]
[If,resetZFolder,
[ISet,Preferences:Misc:Use ZFolders,0]
]
The “Use ZFolders” button has to be turned on otherwise the folder defaults to the last used.