Need a Support for a InDesign script for import bulk list items
I whould like to develop a indesign script to import a batch of list items in combo box Items for interactive form. in indesign
Scope; instead of adding a list items manually one by one. i will create a Text list seprated with paragraph so that my script should import the text to combo box list items.
Please Help me to find the solution .
I got this from ChatGPT:
if (app.documents.length > 0) {
var doc = app.activeDocument;
if (app.selection.length == 2 && app.selection[0] instanceof TextFrame && app.selection[1] instanceof ComboBox) {
var textFrame = app.selection[0];
var comboBox = app.selection[1];
// Clear existing items in the combo box
comboBox.clear();
// Split the text in the text frame by paragraphs
var textItems = textFrame.texts[0].paragraphs;
for (var i = 0; i < textItems.length; i++) {
// Add each paragraph as an item in the combo box
comboBox.add(textItems[i].contents);
}
} else {
alert("Select one text frame and one combo box field.");
}
} else {
alert("Open a document first.");
}
Thanks in advance
