Hi i have to work user Interface and give the input: old chapter: 1 New chapter: 5 it will be change the internal reference and change the year(Ex: 1955 inside the para) and number list. how to presreve this? if(app.documents.length == 0) { alert("Hi User!! Please open the Document") exit(); } var myDoc = app.documents[0]; var window = new Window ("dialog", "Change Cross-References"); window.orientation = "row"; window.preferredSize.width = 100; window.preferredSize.height = 100; window.location = [500, 400]; window.add ("statictext", undefined, "Old_Chapter:"); var find_ref = window.add ("edittext", undefined, ""); window.graphics.backgroundColor = window.graphics.newBrush (window.graphics.BrushType.SOLID_COLOR, [0, 0.5, 0.5, 0.5]); find_ref.characters = 30; window.orientation = "column"; window.add ("statictext", undefined, "New_Chapter:"); var change_Ref = window.add ("edittext", undefined, ""); change_Ref.characters = 30; var myButtonGroup = window.add ("group"); myButtonGroup.alignment = "right"; var Ok =myButtonGroup.add ("button", undefined, "OK"); var Cancel = myButtonGroup.add ("button", undefined, "Cancel"); var myResult = window.show(); //~ if(Cancel.onclick ==1) //~ { //~ alert("Hi User!! Please Enter the values") //~ exit() //~ } var old_Ref = find_ref.text; var new_Ref = change_Ref.text; app.findTextPreferences = app.changeTextPreferences = null; app.findTextPreferences.findWhat = old_Ref; var found = app.documents[0].findText(); for(i=0; i<found.length; i++) { app.findChangeTextOptions.caseSensitive = false; app.findChangeTextOptions.wholeWord = false; app.changeTextPreferences.changeTo = new_Ref; var myChanges = app.documents[0].changeText(); } if(found.length==0) { alert("Hi User!! no text found") exit() } app.findTextPreferences = app.changeTextPreferences = null; thanks, Prabu
... View more