You must be logged in to post Login

Search Forums:


 






Keeping text together …

UserPost

10:56 am
January 11, 2012


gamouning

Member

posts 43

Hi,

I am creating a mailing directory and need to keep all related address information together. Some times address information is missing so there isn't any consistent way to know how many lines each person will contain. Often times, this means a page break will occur in different places in the text. Currently, I have to manual insert page breaks and this is what I would like to avoid.

If it helps, below I have prepared a sample of how my data appears:

Name: Fullname

Home: Address1

Address2

City, State Zip

Home Phone number

Business: Address1

Address2

City, State Zip 

Business Phone number

Email: email address

Name: Fullname

Home: Address1

City, State Zip

Home Phone number

Email: email address


Thanks in advance for your help.

-Greg

11:38 am
January 11, 2012


Jongware

Member

posts 763

Use the Keep options. Set "Keep with Next" to 1 for all lines per set except the last one; set it to 0 for that one.

1:42 pm
January 11, 2012


gamouning

Member

posts 43

Thanks for the reply Jongware. This is quite close to what I desire. The text is staying together and floating across page boundaries without inserting manual page breaks. The only problem I notice is that the style for my last line could be differet depending upon how much address information is included. For example, the last line could be an e-mail address, phone number or address line.

Since I know the first line will always be the name is there some way to use the "Keep with Next" feature so that it based off of the first line? Hope that makes sense. :)

2:28 pm
January 11, 2012


Jongware

Member

posts 763

If you have CS5.5 you can use its new feature "Keep with Previous" — simply reverse all of my instructions above …

For CS5 or earlier I don't have any (non-scripted) solution.

2:51 pm
January 11, 2012


gamouning

Member

posts 43

Ok, I will try to find a copy of CS5.5. In the meantime, do you have a GREP or script you are willing to share?

4:15 pm
January 11, 2012


Jongware

Member

posts 763

GREP is of no use here, and it'd need a custom script — I haven't had this particular need in the past, so that's a no.

4:20 pm
January 11, 2012


Jongware

Member

posts 763

Post edited 4:21 pm – January 11, 2012 by Jongware
Post edited 4:23 pm – January 11, 2012 by Jongware


Hah — I had an idea and it worked!

1. Set all of your text to Keep With Next:1 line. InDesign won't change a thing, because it somehow detects it's nonsense to keep such a long list all together.

2. Run this Javascript:


app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\r(?=Name)";
foundList = app.activeDocument.findGrep (true);
for (i=0; i<foundList.length; i++)
foundList[i].keepWithNext = 0;

3. And suddenly you have all of your "Name" items at the top of a column!

(Edited 3 times, this one ought to be okay now)