Change master page if there is an empty textframe
Hi! Is there a way to assign by scripting a master page in every single page with an empty textframe? Thanks!
_14.jpg)
Hi! Is there a way to assign by scripting a master page in every single page with an empty textframe? Thanks!
_14.jpg)
Hi Frederico,
Try the following, change the string C-Master to the name of the master page that you want to apply.
var tf = app.documents[0].pages.everyItem().textFrames.everyItem().getElements()
for(var i = 0; i < tf.length; i++)
{
if(tf.contents == "")
tf.parentPage.appliedMaster = app.documents[0].masterSpreads.itemByName("C-Master")
}
-Manan
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.