응용 프로그램 스크립트 사이드 바를 사용하여 텍스트를 삽입합니다. 여기서는 입력 할 때 처음에 텍스트를 추가 한 다음 다시 입력해야합니다.개행 문자를 GAS의 insertText에 변수로 전달
추가 된 텍스트는 세로 막대의 텍스트 상자에 의해 결정됩니다.
나는 여기에 애플 리케이션 스크립트 코드 formObject
function sendform(){
var f = document.forms[0].elements;
var data = { "mytext": f[0].value }
google.script.run.withSuccessHandler(ready).withFailureHandler(onFailure).processForm(data);
}
로 값을 전달합니다.
function processForm(fO)
{
var body = DocumentApp.getActiveDocument().getBody();
body.editAsText().insertText(0, "\n\nsometext");
// this will perfectly insert the newlinenewlinesometext to the document
body.editAsText().insertText(0, fO.mytext);
// this will insert \n\nsometext which is wrong
}
encodeURIComponent decodeURIComponent를 사용해 보았지만 여전히 동일한 문제가 있습니다.
제안 사항?