Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

GREP Problems

$
0
0

Hi experts,

 

I want to check the bracket with specific font and alert which page, but when I run the script, it cause indesign crash, it is something wrong with my script, please help me to fix it

 

below is my script:

 

 

checkBracket();

function checkBracket(){

 

    app.findGrepPreferences = NothingEnum.nothing;

    app.changeGrepPreferences = NothingEnum.nothing;

   

    app.findChangeGrepOptions.includeFootnotes = true;

    app.findChangeGrepOptions.includeHiddenLayers = true;

    app.findChangeGrepOptions.includeLockedLayersForFind = true;

    app.findChangeGrepOptions.includeLockedStoriesForFind = true;

    app.findChangeGrepOptions.includeMasterPages = true;

    app.findChangeGrepOptions.widthSensitive = true;

    app.findGrepPreferences.findWhat="\(|\)";

    app.findGrepPreferences.appliedFont = app.fonts.item("DIN Light");

    app.findGrepPreferences.fontStyle = "Regular";

   var myList = "";

 

 

   var myfindGrep=app.findGrep();

    for(i=0; i<myfindGrep.length; i++)

    {

        var item = myfindGrep[i];

        var page = item.parentTextFrames[0].parentPage;

        myList += page.parent.parent.name + " (Page: "+page.name +")\n";

    }//end of loop

  if (item.length>0) {

  alert("Below document(s) have wrong rounded bracket () :\n\n"+ myList +"\nPlease Global");

  }//end of if

else {alert("no");}

    app.findGrepPreferences = NothingEnum.nothing;

    app.changeGrepPreferences = NothingEnum.nothing;

 

 

}//end of function


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>