QScript PageMasters
Jump to navigation
Jump to search
PageMasters
The page masters in the document, in the order they appear in Page Master. Read the masters themselves from subItems. Use copyAfter to create a new page master from an existing one, and moveAfter to reorder the list.
copyAfter(item, after)
Copies a page master to just after after in Page Master. This is how a script creates a new page master: copy the one whose layout is closest to what you want, then rename the copy and edit its slots.
| item | The page master to copy. |
| after | The page master to put the copy after. null puts the copy at the top of Page Master. |
| Returns: | The new page master. |
| Example: | var masters = project.pageMasters;
var title_and_content = masters.subItems.find(function (m) { return m.internalName === 'Item'; });
var copy = masters.copyAfter(title_and_content, masters.subItems[masters.subItems.length - 1]);
copy.name = 'Title and Content (wide)';
|
equals(obj)
Whether two objects are the same.
| obj | The object to compare against. |
| Returns: | true or false |
| Example: | data_file.getQuestionByName('Q2').equals(data_file.questions()[0])
|
moveAfter(item, after)
Moves a page master to just after after in Page Master.
| item | The page master to move. |
| after | The page master to put it after. null moves it to the top of Page Master. |
subItems
The page masters in the document, in the order they appear in Page Master: the six built-in layouts and any the user has created.
| Example: | // List the page masters by name:
project.pageMasters.subItems.forEach(function (m) { log(m.name); });
|
type
Returns "PageMasters".