Copy link to clipboard
Copied
Hi,
I'm creating a weird book full of numbers that I want to increase incrementally in size and leading as the page number gets higher. Is there a way of doing that with GREP? I've searched around but can't seem to find anything. There could be 400+ pages so I don't want to do it manually. Please don't ask why I'm creating the book, it's for an art client. End of story.
If I could adjust the text size and leading very slightly on each page that would be magic. I'm a bit of a GREP novice so please excuse me for not being able to figure this out myself.
Thanks
Copy link to clipboard
Copied
useful link.. if you know scripting change the script to you needs.. else please ping here
Copy link to clipboard
Copied
Thanks for your reply. I'm not overly familiar with scripting. I can probably figure out how to import the script in your link to InDesign, but editing to suit my needs is a step too far for me, I suspect. I'm not a complete dunce though, so if you can give me a couple pointers on what I need to do, hopefully I can figure it out!
Copy link to clipboard
Copied
Okay.. see the script below..
I am changing 7/8 size to 9/11.. so try to change the values as desired..
if(app.books.length==0)
{
alert("please open the book")
exit(0);
}
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
var myBook = app.activeBook;
var myBookContents = app.activeBook.bookContents;
for(k=0; k<myBookContents.length; k++)
{
var myTotalContents = myBookContents
.fullName.toString() app.open(File(myTotalContents))
try{
changeFont("7", "8", "9", "11")
}
catch(e){}
}
function changeFont(currFont, currFontStyle, ChangeFont, ChangeFontStyle)
{
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.pointSize = currFont;
app.findTextPreferences.leading = currFontStyle;
app.changeTextPreferences.pointSize = ChangeFont;
app.changeTextPreferences.leading = ChangeFontStyle;
app.activeDocument.changeText();
app.findTextPreferences = app.changeTextPreferences = null;
}
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
HTH
K
Copy link to clipboard
Copied
OK thanks. Is there a way to bring in the page number as a variable? Say, with each page the point size increases 0.1pt?
Copy link to clipboard
Copied
Yes page.name is useful to get the page number..
check this..
Re: Accessing page number property [CS3] [JS]
Copy link to clipboard
Copied
Thanks for your help, I'll have a read about some script basics and see if I can adjust it to my needs.
Copy link to clipboard
Copied
If you not figure it out... I am changing the current page number into 15..
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.findWhat = "^#";
app.changeTextPreferences.pointSize = "15";
app.activeDocument.changeText();
app.findTextPreferences = app.changeTextPreferences = null;
Happy learning,
K
Copy link to clipboard
Copied
Thanks so much for your help.
I am struggling to understand this as I can't read the script. For instance:
As you can see, I need to go right back to basic JS and learn that before I can even start to understand what each line is doing. I don't really have the time as the book I'm making needs to be finished by Friday. So I think this time I'm going to cut the page number to 200 and I'll do it the 'dumb' way and maybe next week I'll start to learn basic scripting so that in future I can create scripts myself. Or I get the client to pay for someone to make the script and we can have as many page numbers as they want!
Thanks for your help though!
Copy link to clipboard
Copied