Script to find/replace form field descriptions text?
Is there a script I could write to search text within form field descriptions and then to replace text?
I have a document with multiple pages with form fields that have "Theme 1, Theme 2, etc" in the description, and the script should be able to search and replace the word Theme with Subject in all the descritions ... I'd like the script to bring up a prompt that I can type the word i'm searching and then type the word to replace but I'm not quite sure how to handle that either ...
Here is the code I've got started to at least create the pop up
var myDoc = app.activeDocument;
function formFindReplace(p){
var a = new Array;
for(var i = 0; i < p.length; i++){
a.push(p[i].name);
}
return a
}
//popup box
makeDialog();
function makeDialog(){
var theDialog = app.dialogs.add({name:"Form Description find/replace", canCancel:true});
with(theDialog){
with(dialogColumns.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Find:"});
staticTexts.add({staticLabel:"Replace:"});
}
with(dialogColumns.add()){
descFind = ; //field to type
descReplace = ; //field to type
}
}
if(theDialog.show() == true){
descFind = ;
replaceText = ;
theDialog.destroy();
}
}
}
//how do I complete this function?
