Hi @dpajewski, if you have set up the form fields as TextBoxes, similar to my attached demo document, then try the following script—it will set the font, style and size of every TextBox. (Note: TextBoxes are interactive objects, distinct from TextFrames.)
- Mark
/**
* Set font of form field text boxes.
* @author m1b
* @discussion https://community.adobe.com/t5/indesign-discussions/find-replace-a-font-that-is-applied-to-an-interactive-text-field/m-p/13918197
*/
function main() {
var doc = app.activeDocument,
textBoxes = doc.textBoxes.everyItem().getElements();
// also add any anchored textBoxes
textBoxes = textBoxes.concat(doc.stories.everyItem().textBoxes.everyItem().getElements());
// also add any textBoxes in tables
textBoxes = textBoxes.concat(doc.stories.everyItem().tables.everyItem().cells.everyItem().textBoxes.everyItem().getElements());
// for each textBox, set the font etc.
for (var i = 0; i < textBoxes.length; i++) {
textBoxes[i].properties = {
appliedFont: 'Minion Pro',
fontStyle: 'Regular',
fontSize: 12,
};
}
}
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Set Form Text Box Font");
Edit 2023-07-08: Now collects TextBoxes from tables.