Copy link to clipboard
Copied
Hi,
I've searched around but since I'm rather new to this I'm not sure of what exactly to search for. I have some documents in plain text that I'm wanting to format. Would it be possible for me to write a script that (indents are extra dream features)-
1. searches for 2 blank linkes together
1.5. resizes text box to bottom of those lines, then resizes next text box to create blank space at top
2. applies style 1 to next paragraph
3. applies style 2 to following paragraph
and repeats...?
If it's possible to do this then I'd like to learn how to do it myself, so if someone can let me know the phrases I should search for that would be much appreciated.
Thanks!
Copy link to clipboard
Copied
Hi,
yes probably. Just could you redefine point 1, screenshot maybe ?
Copy link to clipboard
Copied
Thanks for having a look. Sorry I wasn't clear. I should have said search for two empty paragraphs. If I was doing a search on the document I would search for "^p^p^p".
So in the text file I have...
Last paragraph in chapter
(Blank line)
(Blank line)
New chapter title
First paragraph of new chapter
And I'd love it to automatically format the chapter title and first paragraph with predefined styles, and preferably start the new chapter on a new page also (the entire book is a single 'story' I think InDesign calls it). Is that a bit clearer?
Copy link to clipboard
Copied
Hi,
Still no code but something about workaround:
1. Are textFrames of your story linked?
2. Are you sure that resizing boxes before applying paraStyles will work good for you?
3. Is a good way to apply "style2 to entire text and - after this - "style1" to specific parts only?
Jarek
Copy link to clipboard
Copied
Thanks Jarek,
Yes, all text boxes that contain the novel are linked (the first few in the document aren't but they are just title, copyright info, contents etc).
I think [Jongware] below you got to what you're saying in 2. and that looks like a far better solution. I didn't know I could do that. I look forward to playing around there and seeing what I can do with those settings.
In the novel part I use 3 different paragraph styles, so there's chapter title, first paragraph, and rest of them. I figured I'd assign everything to the most common style first, then have the script change the others. If I learn how to write scripts I can just make the script do that step also I guess!
Copy link to clipboard
Copied
missyc71072616 wrote
1.5. resizes text box to bottom of those lines, then resizes next text box to create blank space at top
The first half of this step ("1.25") is absolutely not necessary, and may even be quite destructive. With InDesign, you do not need to make frames smaller to make text flow to the next page! Just do any one of these things (only one of these, not all at the same time):
1. add a manual Page Break at the position where you want to break the page
2. set the Keep Options for that to-be first paragraph to "Start Paragraph: On Next Page"
3. set the Keep Options for the style of your chapter titles to "Start Paragraph: One Next Page".
Similarly, it is not necessary to mess with frames to make text start lower. The easiest way, again, is to do so in that Chapter Title style.
… With that, I think your script requirements change to "find 2 returns, apply a style to the paragraphs after that".
Copy link to clipboard
Copied
https://forums.adobe.com/people/%5BJongware%5D wrote
The first half of this step ("1.25") is absolutely not necessary, and may even be quite destructive. With InDesign, you do not need to make frames smaller to make text flow to the next page! Just do any one of these things (only one of these, not all at the same time):
1. add a manual Page Break at the position where you want to break the page
2. set the Keep Options for that to-be first paragraph to "Start Paragraph: On Next Page"
3. set the Keep Options for the style of your chapter titles to "Start Paragraph: One Next Page".
Similarly, it is not necessary to mess with frames to make text start lower. The easiest way, again, is to do so in that Chapter Title style.
… With that, I think your script requirements change to "find 2 returns, apply a style to the paragraphs after that".
Thanks so much [Jongware], even if I don't get around to learning how to do scripts that makes my life so much easier and my job much faster. I'm self-taught at InDesign after using Scribus for a short time so there is a lot I don't know.
Once I tweak the styles you're correct. The script is just -
1. find 2 returns
2. apply title style to next paragraph
3. apply first para style to next paragraph
repeat to end.
Do you have any hints as to the phrase/s I would use to look up how to create a script to do these? I find knowing the phrasing of my search one of the hardest parts.
Copy link to clipboard
Copied
https://forums.adobe.com/people/%5BJongware%5D wrote
The first half of this step ("1.25") is absolutely not necessary, and may even be quite destructive. With InDesign, you do not need to make frames smaller to make text flow to the next page! Just do any one of these things (only one of these, not all at the same time):
3. set the Keep Options for the style of your chapter titles to "Start Paragraph: One Next Page".
Similarly, it is not necessary to mess with frames to make text start lower. The easiest way, again, is to do so in that Chapter Title style.
This has sped up work infinitely already! A nice clear rule above the chapter title and set to start on new page... thank you!