Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87158

Re: Create alert message

$
0
0

Hi Hasvi,

 

Below is the answer:

 

if(app.documents.length == 0)
{    alert("Please Open the Document");    exit(0);    }

var myDoc = app.activeDocument;


app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;


    var myUsedFonts = myDoc.fonts;    for (var i = 0; i < myUsedFonts.length; i++) {    if (myUsedFonts[i].status != "1718831470")    {        alert("Please Fix Missing Font")        exit(0);        }    }    var myUsedLinks = myDoc.links;    for (var i = 0; i < myUsedLinks.length; i++)    {        if (myUsedLinks[i].status == LinkStatus.linkMissing || myUsedLinks[i].status == LinkStatus.LINK_OUT_OF_DATE)        {            alert("Please Fix Missing Link");            exit(0);            }        }       var myOverflow = FindOverflowText();    if (myOverflow == true)    {        alert("Please Fix Overflow")        exit(0);        }   


//Function FindOverflowText Start
function FindOverflowText() {
    myPages = myDoc.pages;    for (i = myPages.length - 1; i >= 0; i--) {        objTextFrames = myPages[i].textFrames;        for (j = objTextFrames.length - 1; j >= 0; j--) {            objTextFrame = objTextFrames[j];            if (objTextFrame.overflows == true) {                objTextFrame.select();                return true;            }        }    }    return false;
}

 

 

If my coding helps you, then please click the correct answers.

 

Thanks

Siraj


Viewing all articles
Browse latest Browse all 87158

Trending Articles



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