-
1. Re: Prevent Indenting of first paragraphs
[Jongware] Oct 8, 2009 1:17 PM (in response to Tony Toy)1 person found this helpfulAutomatically: no. InDesign does not format any paragraphs automatically (although GREP styles do, for character styles).
You can set the 'with' paragraph as "Next Style" in the 'without' paragraph, and in the 'with' paragraph style, set "Same Style" as its next style. Then select a range of paragraphs and choose "Apply this style, then next" from the Paragraph Style menu.
-
2. Re: Prevent Indenting of first paragraphs
Tony Toy Oct 8, 2009 1:25 PM (in response to [Jongware])Thanks for the quick reply. This saves me some time.
-
3. Re: Prevent Indenting of first paragraphs
[Jongware] Oct 8, 2009 1:29 PM (in response to Tony Toy)1 person found this helpfulIf you know how to use scripts, well, I could whip up a javascript in minutes that goes over your document and changes any 'with' paragraph without a previous 'with' or 'without' to 'without' and any 'without' not preceeded by 'with' or 'without' to 'with'. With out, I mean without a problem. (Sorry, ran out of my withs.)
-
4. Re: Prevent Indenting of first paragraphs
Tony Toy Oct 8, 2009 1:33 PM (in response to [Jongware])thanks, i use scripts a great deal. mostly for find+replace type stuff. I think the "apply this + next style" tip you gave me would be suffient. but if you write one i'd be greatful because I could use it for other projects.
-
5. Re: Prevent Indenting of first paragraphs
[Jongware] Oct 8, 2009 1:55 PM (in response to Tony Toy)Here you go, fresh out of TextPad. Be sure to change the style names in the first 2 lines.
a = "without"; b = "with";if (app.selection.length != 1 || !app.selection[0].hasOwnProperty("baseline")) { alert ("Please click the text cursor in a story before running this script."); exit(0); } try { stylea = app.activeDocument.paragraphStyles.item(a); } catch (e) { } if (stylea == null) { alert ("Eh. Style "+a+" doesn't seem to exist.\nChange the name in this script"); exit(0); } try { styleb = app.activeDocument.paragraphStyles.item(b); } catch (e) { } if (styleb == null) { alert ("Oh. Now style "+b+" doesn't exist either.\nChange the name in this script"); exit(0); } allpars = app.selection[0].parentStory.paragraphs; for (p=0; p<allpars.length; p++) { if (allpars[p].appliedParagraphStyle == stylea || allpars[p].appliedParagraphStyle == styleb) { if (p > 0 && (allpars[p-1].appliedParagraphStyle == stylea || allpars[p-1].appliedParagraphStyle == styleb)) allpars[p].applyParagraphStyle(styleb,false); else allpars[p].applyParagraphStyle(stylea,false); } }
Not tested on CS3 or newer, but it oughta work. Supposedly, it changes all occurrences of one of the styles to the 'without' style, except when one of the preceding is one of same. Theoretically, it should leave manual formatting alone, but do a "Save" first just in case.
-
6. Re: Prevent Indenting of first paragraphs
M.Jay.Victor Oct 8, 2009 6:28 PM (in response to [Jongware])You can also apply the paragraph style to an object style and check the "apply with next style" box, then set it to a hotkey.
-
7. Re: Prevent Indenting of first paragraphs
[Jongware] Oct 9, 2009 4:38 AM (in response to [Jongware])Hm. It seems to toggle some paragraphs when run more than once! This version is slightly improved:
a = "without"; b = "with"; if (app.selection.length != 1 || !app.selection[0].hasOwnProperty("baseline")) { alert ("Please click the text cursor in a story before running this script."); exit(0); } try { stylea = app.activeDocument.paragraphStyles.item(a); } catch (e) { } if (stylea == null) { alert ("Eh. Style "+a+" doesn't seem to exist.\nChange the name in this script"); exit(0); } try { styleb = app.activeDocument.paragraphStyles.item(b); } catch (e) { } if (styleb == null) { alert ("Oh. Now style "+b+" doesn't exist either.\nChange the name in this script"); exit(0); } allpars = app.selection[0].parentStory.paragraphs; for (p=0; p<allpars.length; p++) { if (allpars[p].appliedParagraphStyle == stylea || allpars[p].appliedParagraphStyle == styleb) { if (allpars[p].appliedParagraphStyle != stylea) { allpars[p].applyParagraphStyle(stylea,false); } if (p > 0 && (allpars[p-1].appliedParagraphStyle == stylea || allpars[p-1].appliedParagraphStyle == styleb) && allpars[p].appliedParagraphStyle != styleb) { allpars[p].applyParagraphStyle(styleb,false); } } }
-
8. Re: Prevent Indenting of first paragraphs
mariana pineda Oct 9, 2009 5:23 AM (in response to Tony Toy)What is the difference between using this script (it works very fast!!!) or using a paragraph style?
I mean in terms of manual operations...
Both oblige to insert the cursor in the without paragraph.
What is de idea behind this? It seems powerful but I do not know how to use it extensively...