Hello @isNaN,
As we can see, the file script.docbuilder exists but is not located in the specified path for execution.
We recommend moving the script.docbuilder file to the folder C:\Users\etsme.
Otherwise, the script will not run because the file cannot be found when executing from the folder.
I don’t quite see the file with .docbuilder extension that is used by Document Builder. You are executing some .scripts file instead of used format. What is the point of that?
the builder.scripts content as followed,the codes from official demo:
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Dear John Smith.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("ONLYOFFICE is glad to announce that starting today, you are appointed Commercial director to the company of your dream.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("Please note: ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText("this text is used to demonstrate the possibilities of ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText(" and cannot be used as real appointment to the position in any real company.");
oParagraph.AddElement(oRun);
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Best regards,");
oParagraph.AddLineBreak();
oParagraph.AddText("ONLYOFFICE Document Builder Team");
oParagraph.AddText("中文内容");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SampleText.docx");
builder.CloseFile();
I meant that extension you are using is not .docbuilder. Even though it should work, I recommend using .docbuilder only.
Also, I failed to note that PowerShell is used instead of Command Prompt, sorry. Since these are quite different operators, to set up variable in PowerShell you need to execute it as follows: