Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[cs3][JS]Find Enter with no text in Layout

Community Beginner ,
Oct 21, 2009 Oct 21, 2009

Hi,

   I need to find enter with no text(idle) in a Layout.I have used the following code.

        app.findGrepPreferences = NothingEnum.nothing;
        app.changeGrepPreferences = NothingEnum.nothing;

        app.findGrepPreferences.findWhat ="\n";
        app.findChangeGrepOptions.includeFootnotes = false;
        app.findChangeGrepOptions.includeHiddenLayers = false;
        app.findChangeGrepOptions.includeLockedLayersForFind = false;
        app.findChangeGrepOptions.includeLockedStoriesForFind = false;
        app.findChangeGrepOptions.includeMasterPages = false;
       
        var myFoundItems=new Array;
        myFoundItems=app.activeDocument.findGrep();
        var len=myFoundItems.length;
        alert(len);

I don't know whether my approach is correct or not? Please suggest me.

Regards

Kumar

TOPICS
Scripting
561
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 21, 2009 Oct 21, 2009

Try this:

app.findGrepPreferences.findWhat ="^\\r";

@+

Marc

[Edit: paragraph meta is \r and not \n]

Translate
LEGEND ,
Oct 21, 2009 Oct 21, 2009

hi Kumar,

you need to find "double enter" and then process second paragraph in each found result - but you need to process found items backward

or if you want to find empty TextFrames - you wont find them in this way - becuase empty TFs are empty no enter or any other characters

robin

www.adobescripts.co.uk

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 21, 2009 Oct 21, 2009
LATEST

Try this:

app.findGrepPreferences.findWhat ="^\\r";

@+

Marc

[Edit: paragraph meta is \r and not \n]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines