Bridgetalk – adobe scripting saving with variables, proper quoting

I’m having an issue with saving a file and I can’t tell why it’s not working. This is original code. I believe I’m commenting out the variables incorrectly or adobe syntax is incorrect. Does anyone have experience with this? (part that is broken: ,app.activeDocument.saveAs(File('"+psdpath+"'/' + doc.name.replace('PLACEHOLDER', '"+parentdirectory+"'))";). Quote variations are important otherwise it doesn’t properly send to illustrator.

Full script:

#target photoshop
//run action in photoshop
app.doAction ("action name", "action set name");
//get path of the open document
var psdpath = activeDocument.path.fsName;
//get directory name of psd, to use in filename later
var parentdirectory = activeDocument.path.name;

//start bridgetalk
var bt = new BridgeTalk;
//targets version 25. v26 crashes if window isnt active at run
        bt.target = "illustrator-25";
//run action in illustrator (which opens an eps w/linked file and performs certain tasks) and then save the document
        var script = "app.doScript('action name', 'action set name'),app.activeDocument.saveAs(File('"+psdpath+"'/' + doc.name.replace('PLACEHOLDER', '"+parentdirectory+"'))";
//the entire action must be within double quotes        
//     var script = alert("test", "this sends alert to photoshop");
//     var script = "alert('test', 'this sends alert to illustrator'),alert('"+psdpath+"', '"+psdpath+"')"; //psdpath is properly sent to illustrator
        bt.body = script;
        bt.send();