2018.2

Table Of Contents
The new result set is of the type QueryResults, just like the results object which is also the
result of a (hidden) query (see "results" on the facing page), but it is read-only.
This function can only be called in a Post Pagination Script (see "Post Pagination Scripts" on
page383). It is indispensable in a script that creates a table of contents, as described in the
following topic: "Creating a Table Of Contents" on page385.
selector
A String containing a CSS selector. See https://www.w3schools.com/cssref/css_selectors.asp
for CSS selectors and combinations of CSS selectors.
Example
This script returns all level 1 headings in all sections of the Print context.
var headings = merge.context.query("h1");
PaginationInfo
The PaginationInfo object is returned by the info() function of the results object (see "info()"
on page782 and "results" on the facing page). It contains information about where an element
is located: on which page and which sheet, and the section in which the element is located.
This object (as well as the info() function) is only available in Post Pagination Scripts (see "Post
Pagination Scripts" on page383). It is essential in a Post Pagination Script that creates a table
of contents, as described in the following topic: "Creating a Table Of Contents" on page385.
Field Type Description
pageCount Number
The number of pages in the section in which the first element of
the results is located.
pageNo Number The page number on which the first element of the results is
located.
"section"
on
page782
Section The section in which the element is located. This is always a
Print section, since Post Pagination Scripts only operate on the
Print context.
Page 777