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

More than 3 hyphen

New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Hi anyone can help me on this, We have some set pages on that. Each page should have only 3 hyphen is allowed. If more than three hyphen it will need to shows an alert with the page number.

Example : Page : 33 have 5 hyphen then the alert shows : Page 33 have more hyphen.

TOPICS
Scripting

Views

194

Translate

Translate

Report

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 ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

hi thanks for the reply, but in a page only 3 hyphen is allowed, whether they  come together (line by line) or any where in the page.

Example :

1st hyphen comes in 4th line.

2nd hyphen comes in 8th line.

3rd hyphen comes in 19th line.

If 4th hyphen comes in 20th line or any. Need to show alert as 'Page contain more than 3 hyphen'.

Votes

Translate

Translate

Report

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 ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

LATEST

Just to start.. try and modify as you need..

var doc = app.activeDocument,   

    mystories = doc.stories;   

    var myarray=[];

for(var i=0;i<mystories.length;i++)   

{   

        var myline = mystories.lines;   

        for(var j=0;j<myline.length;j++)   

        {   

                if(myline.words[-1].lines.length >=2) 

                { 

                   

                    myarray.push(myline.words[-1])

                    } 

            }   

    } 

if(myarray.length>3){

alert(myarray.length+" Hyphens in Page: " +doc.pages[0].name) 

}

else{ alert("No Error")}

Votes

Translate

Translate

Report

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