2022.2

Table Of Contents
Forthetotalpageandsheetcountofall Print sectionstogetherusethemergeobject's"Pagination"
onpage857(seealso:"merge"onpage856).
Field Type Description
pageCount
Number
The number of pages in the page bundle associated with the section in which the first
element of the results is located.
pageNo
Number Thepagenumberonwhichthefirstelementoftheresultsislocated.
"section"on
page848
Section Thesectioninwhichtheelementislocated.ThisisalwaysaPrintsection,sincePostPaginationScripts
onlyoperateonthePrintcontext.
sheetCount
Number Thenumberofsheetsinthepagebundleassociatedwiththesectioninwhichthefirstelementoftheresults
islocated.
sheetNo
Number Thesheetnumberonwhichthefirstelementoftheresultsislocated.
results
Theresultsobject(type:QueryResults)istheresultofthequeryforHTMLelementsthatmatch
theselectorofthescript.TheselectorofascriptcanbespecifiedintheScriptEditorandisvisiblein
thesecondcolumnoftheScriptspane,nexttothenameofthescript.
If,forexample,ascriptwouldhavetheselectorp.onlyCanada,thescriptwouldapplytoallpara-
graphsthathavetheclassonlyCanada.(ClassescanbedefinedintheAttributespaneattheright:
selecttheelementinthecontentandtypetheclass(es)intheClassfield.)
Thescriptcouldthenusetheresultsobjecttohideorshowthoseparagraphs,dependingonthe
valueofthedatafieldCountryinthecurrentrecord:
if (record.fields["Country"] == "CANADA") {
results.show();
} else {
results.hide();
}
Note: Thisobjectcan'tbeusedinControlScripts,becausetheydon'thaveaselector.
Tip: Theeasiestwaytoaccesstheelementsinaresultsetonebyone,isbysettingthescopeof
thescriptto"Eachmatchedelement"andusingthethisobject(see"this"onpage781).
Page 843