🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9677

Re: Overflow textFrame - problem

#9677
From: Dave_Saunders
Date: Thu, 20 Jul 2006 11:48
39 lines
2641 bytes
You can write a script to replicate the behavior you describe whether or not the autoflow option is available. I use this function:

function DumbRunPages(theDoc, theStory) {
	// What makes this "dumb" is that default master pages are used.
	var uRuler = theDoc.viewPreferences.rulerOrigin;
	theDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;
	while (theStory.textFrames[-1].overflows) {
		theDoc.documentPreferences.pagesPerDocument = theDoc.documentPreferences.pagesPerDocument + 1;
		var backPage = theDoc.pages[-1];
		app.activeWindow.activePage = backPage;
		backPage.appliedMaster = theDoc.pages[-2].appliedMaster;
		var myPbounds = backPage.bounds;
		var myNewTF = backPage.textFrames.add();
		if ((backPage.name % 2 == 1) || (!theDoc.documentPreferences.facingPages)) {
 			myNewTF.geometricBounds =
 				[myPbounds[0] + backPage.marginPreferences.top,
 					myPbounds[1] + backPage.marginPreferences.left,
 					myPbounds[2] - backPage.marginPreferences.bottom,
 				 	myPbounds[3] - backPage.marginPreferences.right];
		} else {
			myNewTF.geometricBounds =
				[myPbounds[0] + backPage.marginPreferences.top,
					myPbounds[1] + backPage.marginPreferences.right,
					myPbounds[2] - backPage.marginPreferences.bottom,
					myPbounds[3] - backPage.marginPreferences.left];
		}
		myNewTF.itemLayer = theStory.textFrames[-1].itemLayer;
		myNewTF.previousTextFrame = theStory.textFrames[-1];
		myNewTF.textFramePreferences.textColumnCount = backPage.marginPreferences.columnCount;
		myNewTF.textFramePreferences.textColumnGutter = backPage.marginPreferences.columnGutter;
		if (myNewTF.characters.length == 0){
			theDoc.viewPreferences.rulerOrigin = uRuler;
			throw ("Permanently overset"); // This indicates a permanent overset condition so break out of loop
		}
	}
	theDoc.viewPreferences.rulerOrigin = uRuler;
}

Dave
Technical Details
Message-ID: <3bc0fa05.1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!195.62.97.14.MISMATCH!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing
References: <3bc0fa05.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,36a1ae946fdaf573
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Dave_Saunders@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: Overflow textFrame - problem
Message-ID: <3bc0fa05.1@webcrossing.la2eafNXanI>
Date: Thu, 20 Jul 2006 04:48:08 -0700
References: <3bc0fa05.-1@webcrossing.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!195.62.97.14.MISMATCH!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing