You are on page 1of 1

1 Layout

Chapter Update Status


CS6 Unchanged

Getting started
This chapter presents layout-related use cases. To solve a layout-related programming problem, like
creating a spread or finding the frames in a spread, look for a use case that matches your needs.

To learn about how layout works and how it is organized, do the following:

 Run through the activities in “Exploring layout with SnippetRunner”, to learn how to explore the
layout-related objects in a document and familiarize yourself with layout-related sample code.

 Read the “Layout Fundamentals” chapter in Adobe InDesign Programming Guide.

Exploring layout with SnippetRunner


SnippetRunner is a plug-in that lets you run code snippets provided in the SDK. Several code snippets are
provided that let you explore the layout-related objects in a document.

Solution

1. Run Adobe® InDesign® with the SnippetRunner plug-in present. For instructions on using the plug-in,
see the API documentation page for SnippetRunner.

2. Run the CreateDocument code snippet.

3. Run the InspectLayoutModel code snippet to create a textual report about the objects in the
document’s layout hierarchy.

4. Run the CreateFrame code snippet.

5. Deselect the new frame and run the InspectLayoutModel code snippet, to see how the document’s
layout hierarchy has changed. A new kSplineItemBoss is created.

NOTE: If an object is selected, InspectLayoutModel reports the hierarchy of only the selected object. If
nothing is selected, it reports the hierarchy of the entire document.

6. Run the PlaceFile code snippet, and place an image file.

7. Make sure the placed frame is selected, and run the InspectLayoutModel code snippet to report the
objects in the hierarchy of the graphic frame.

8. Create other objects in a document or open documents containing layouts that you want to examine,
and use InspectLayoutModel to examine the boss objects representing the layout hierarchy.

You might also like