0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Indesign CS3ファイルフォント・リンク・オーバーテキスト不備をチェック

0
Last updated at Posted at 2017-10-06
font-link-overflow.jsx
var doc=app.activeDocument;
if(doc){
if(!(checkFonts(doc)&&checkLinks(doc)&&checkOverflow(doc))) exit();
}
/////////////////////////////////////
function checkFonts(doc) {
    var fontObj = doc.fonts;
    var L = fontObj.length;
    while (L--) {
        if (fontObj[L].status !== FontStatus.INSTALLED) {
            alert("環境にないフォントがあります");
            return false;
        }
    }
    return true;
}
////////////////////////////////////
function checkLinks(doc) {
    var linkObj = doc.links;
    var L = linkObj.length;
    while (L--) {
        var myStatus = linkObj[L].status;
        if (myStatus === LinkStatus.LINK_MISSING || myStatus === LinkStatus.LINK_OUT_OF_DATE) {
            alert("無効・未更新 なリンクがあります");
            return false;
        }
    }
    return true;
}
////////////////////////////////////
function checkOverflow(doc) {
    var pageObj = doc.pages;
    var pL = pageObj.length;
    while (pL--) {
        var tL = pageObj[pL].textFrames.length;
        while (tL--) {
            if (pageObj[pL].textFrames[tL].overflows) {
                alert(pageObj[pL].textFrames[tL].parent.name + "  ページに文字溢れがあります");
                return false;
            }
        }
    }
    return true;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?