3 Replies Latest reply on Mar 1, 2016 12:28 AM by selvam214

    Dialogue box not show in CC2014

    selvam214 Level 1

      Hi,

      The Dialogue box not show in CC2014, but earlier versions working fine for me. The related codes are below, can you please guide me to solve this issue.

       

       

      showDialog()  

          function showDialog(){ 

               app.selection = NothingEnum.NOTHING;

               app.findGrepPreferences = app.changeGrepPreferences = null;

               app.findGrepPreferences.findWhat  = "\\n";

               app.changeTextPreferences.changeTo=" ";

               app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

               var myTextFrames; 

               var foundIndex = 0;      

               var findNext = function(){ 

                    myTextFrames = app.activeDocument.findGrep(); 

                    for (etf=foundIndex; etf<myTextFrames.length; etf++){ 

                         if (myTextFrames[etf]){

                              myTextFrames[etf].showText(); 

                              foundIndex = etf+1; 

                              app.activeDocument.layoutWindows[0].zoomPercentage=200; 

                              return; 

                         } 

                    }  

                    alert ("No more forced line found!"); 

                    app.selection = NothingEnum.NOTHING; 

                    foundIndex = 0;

                    myDialog.close();

                    return; 

               } 

            

               var removeFrame = function(){ 

                    if (app.selection.length==0){ 

                         alert("Nothing to remove"); 

                    } else { 

                         app.selection[0].remove(); 

                            foundIndex--; 

                         findNext(); 

                    } 

               } 

                

               var replacesapce = function(){ 

                    if (app.selection.length==0){ 

                         alert("Nothing to remove"); 

                    } else { 

                         app.selection[0].contents=" "; 

                            foundIndex--; 

                         findNext(); 

                    } 

               } 

       

               myDialog = new Window("palette", "FORCE LINE BREAK AVAILABLE!");

               myDialog.add ("statictext", undefined, "Do you want to modify one-by-one?");

            

               myDialog.myFnBtn = myDialog.add("button", undefined, "Find Next"); 

               myDialog.myFnBtn.onClick = findNext; 

            

               myDialog.myRmBtn = myDialog.add("button", undefined, "Remove"); 

               myDialog.myRmBtn.onClick = removeFrame; 

            

               myDialog.mySkBtn = myDialog.add("button", undefined, "Replace"); 

               myDialog.mySkBtn.onClick = replacesapce; 

              

               myDialog.mySkBtnb = myDialog.add("button", undefined, "Exit"); 

               myDialog.mySkBtnb.onClick = replacesapce; 

              

               myDialog.mySkBtnb.onClick = function(){ 

                    myDialog.close(); 

               } 

               myDialog.show(); 

               findNext(); 

          }