LoginSignup
5
4

More than 5 years have passed since last update.

【InDesign】DocumentからスタートしてDocumentまで戻る【DOM散歩】

Last updated at Posted at 2014-04-03

InDesign CS4 + ExtendScript Toolkitで確認。

var doc = app.activeDocument;

$.writeln( doc ===
  app.activeDocument      // Document
    .stories              //  Stories
    .item(0)              //   Story
    .paragraphs           //    Paragraphs
    .item(0)              //     Paragraph
    .parentTextFrames[0]  //    TextFrame (itemメソッドは無い)
    .parent               //   Page
    .parent               //  Spread
    .parent               // Document
  ? true : false
);

$.writeln( doc ===
  app.activeDocument  // Document
    .spreads          //  Spreads (Document.pagesも可)
    .item(0)          //   Spread
    .pages            //    Pages
    .item(0)          //     Page
    .textFrames       //      TextFrames
    .item(0)          //       TextFrame
    .paragraphs       //        Paragraphs
    .item(0)          //         Paragraph
    .parentStory      //        Story
    .parent           //       Document
  ? true : false
);
5
4
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
5
4