You can solve this problem, by deleting the return from the 'findWhat' string, e.g. app.doScript(main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "remove tab column"); function main() { if (!(app.selection.length == 1 && app.selection[0].hasOwnProperty("baseline"))) return; var curSel = app.selection[0]; var myColumn = prompt("Enter column number to delete",""); if (!myColumn) return; var allParas = curSel.paragraphs.everyItem().getElements(); app.findTextPreferences = app.changeTextPreferences = null; for (var i = allParas.length-1; i >= 0; i--) { var curPara = allParas; var curParaContents = curPara.contents; var x = curParaContents.split("\t"); var f = x[myColumn-1].replace("\r",""); app.findTextPreferences.findWhat = f; app.changeTextPreferences.changeTo =""; curPara.changeText(); } app.findTextPreferences = app.changeTextPreferences = null; } Notice also, that line 18 will throw an error, if you e.g. have 6 columns and enter in the prompt-dialog 7 or if you input is not an integer. So you should check this as well. 😉
... View more