Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[InDesign] ページ上半分のマスターページアイテムをオーバーライドするスクリプト
/**
* @fileoverview ページ上半分のマスターページアイテムをオーバーライドするスクリプト
* @author Yusuke SAEGUSA
* @version 0.0.1
*/
var myDoc = app.activeDocument;
var pag = myDoc.pages;
for (var i = 0, len = pag.length; i < len; i++) {
var halfHeight = (pag[i].bounds[2] - pag[i].bounds[0]) / 2; //ページの半分
var mpItems = pag[i].masterPageItems;
if (mpItems.length === 0) { continue; }
for (var j = 0; j < mpItems.length; j++) {
if (mpItems[j].allowOverrides
&& mpItems[j].geometricBounds[2] < halfHeight) {
mpItems[j].override(pag[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment