Free Add-a-Page Script
InDesign expert Peter Kahrel wrote a free script for InDesign users that solves a common annoyance, and is graciously sharing it with other InDesign fans here at InDesignSecrets.com.
Normally, when you’re writing your Great American Novel and come to the end of the last page’s text frame, InDesign just oversets that frame, it doesn’t add a page for you. You have to do that yourself, and then thread the overset frame to a new one on the new page. Only then can you switch back to the Type tool and continue typing.
Peter’s cross-platform Javascript is called Add-a-Page. It’s simple but oh-so-useful: it adds a page at the end of the current document, places a text frame on it, and links the new text frame to the one containing your text cursor.
With the script installed, that means when you’re nearing the end of the last text frame, you could just double-click Peter’s script in the Scripts palette (or use a keyboard shortcut you’ve assigned to it), and keep typing. The cursor jumps to the frame in the next page when it needs to, and your train of thought is uninterrupted.
Thanks, Peter!
Thanks Peter!! This is great!
when I double clicked on the “kahreladdpage.jsx” the script opened in a different window. Not sure what todo with the script alone.
Mayra,
It sounds like you didn’t read the “How to install an InDesign script” instructions. It worked fine for me.
hey guys… do you know if this script works on indesign cs (mac)? i did the same thing for my indesign cs2 (pc) at work and no drama. any suggestions?
Mayra, the script is an uncompressed text file so downloading it does what your browser normally does with uncompressed text files … suppose we should .zip it or something. But if you right-click on it you can choose Download Linked File which should work. Even so, my browser downloaded it with a .txt extension added after the .jsx, so I had to delete the extraneous extension.
Tricia, all I know is that it definitely works on Mac InDesign CS2, haven’t tested it on Windows CS2 but it should work there too. When you say “no drama” is that good or bad. :-) As far as compatibility w/CS1, there may be something new in the javascript that CS1 doesn’t recognize.
I see. I guess I’ll probably have to upgrade to CS2 then. Which is probably a good thing. =)
Tricia, try renaming the file .js and see if that works.
Seems that the script ignores margin preferences of even pages of double sided spreads. The left margin alway is the left margin of odd pages.
Thanks for the Script anyway.
Oscar
To distinguish between even and odd pages fo double sided spreads you need something like this:
===================
// add a page at the end of the current document,
// place a text frame on it, and link the text frame
doc = app.activeDocument
np = doc.pages.add();
marg = np.marginPreferences;
if (np.documentOffset%2) // margin of even or odd page
{
theLeftMargin = marg.left;
theRightMargin = marg.right;
}
else
{
theLeftMargin = marg.right;
theRightMargin = marg.left;
}
gb = [marg.top, theLeftMargin,
doc.documentPreferences.pageHeight – marg.bottom,
doc.documentPreferences.pageWidth – theRightMargin];
oldRuler = doc.viewPreferences.rulerOrigin
doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
with( doc.pages[-1].textFrames.add() )
{
geometricBounds = gb;
previousTextFrame = doc.pages[-2].textFrames[0];
}
doc.viewPreferences.rulerOrigin = oldRuler
===================
Oscar
When I clicked on the link I got this.
// add a page at the end of the current document,
// place a text frame on it, and link the text frame
doc = app.activeDocument
np = doc.pages.add();
marg = np.marginPreferences;
gb = [marg.top, marg.left,
doc.documentPreferences.pageHeight – marg.bottom,
doc.documentPreferences.pageWidth – marg.right];
oldRuler = doc.viewPreferences.rulerOrigin
doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
with( doc.pages[-1].textFrames.add() )
{
geometricBounds = gb;
previousTextFrame = doc.pages[-2].textFrames[0];
}
doc.viewPreferences.rulerOrigin = oldRuler
the script opened in a browser window. How do I drag that into a indesign package?
Ralph, it did that because the .jsx file is actually a text file and your browser is set to open those in a browser window. (mine downloads text files.) Try right-clicking on the link and choosing Download Linked File. Or you can copy/paste the content that appears in the browser window into a new plaintext document and save it with a .jsx extension.
Using windows version CS1, renaming the .jsx file to a .js file lets the script work perfect. Just wanted to let those of you know who were still unclear. Thank you!!
Your site is perfect!
Sweet script! As a Graphic Designer, this one will come in very handy. I’ve added a Keyboard Shortcut for this: Option + Shift + P (on the Mac), since Command + Shift + P is the built in Add Page feature (but does not include the addition of a link text box).