QScript PageMaster

From Q
Jump to navigation Jump to search

PageMaster

A page master (a master slide) in the document - the reusable layout that pages are based on, as shown in Page Master. Obtain page masters from project.pageMasters(); a page's current master is the one whose guid matches that page's pageLayout. Note that an actual page's layout can differ from its master if the page has been modified after being created from the master (e.g. the slots of the master can be moved, resized, or deleted on the page).

equals(obj)

Whether two objects are the same.
objThe object to compare against.
Returns:true or false
Example:
data_file.getQuestionByName('Q2').equals(data_file.questions()[0])

guid

The page master's GUID. Set a page's pageLayout to this to apply this master to the page.

internalName

The built-in layout identifier — one of 'Title', 'Item', 'ItemAndText', 'TwoItems', 'TitleOnly' or 'Blank' — or null for a custom page master.

name

Get/set the page master's name, as shown in Page Master.
Example:
 // List the page masters by name:
 project.pageMasters().forEach(function (m) { log(m.name); });

 // Rename a custom page master:
 var master = project.pageMasters().find(function (m) { return m.name === 'Layout 1'; });
 master.name = 'Layout 1 (renamed)';

subItems

The slots that items can occupy on this page master, ordered by slotNumber (so subItems[n].slotNumber is n). Place an item in a slot by setting the item's slotNumber to a slot's slotNumber.

type

Returns "PageMaster".