Professional Web Applications Themes

Make alternate Rows of text Bold - Adobe Indesign Windows

I have a doent that I carried forward from PageMaker. I used to script to make alternate rows of text bold. I don't know where the script is any more. I have moved the doent into InDesign CS and have lost my alternating bold rows of text due to changes in text. I know that you can do this in tables (make alternating rows of bold) but I don't want to put my text and tables. What is the best approach now? Rick...

  1. #1

    Default Make alternate Rows of text Bold

    I have a doent that I carried forward from PageMaker. I used to script to make alternate rows of text bold.
    I don't know where the script is any more.

    I have moved the doent into InDesign CS and have lost my alternating bold rows of text due to changes in text.
    I know that you can do this in tables (make alternating rows of bold) but I don't want to put my text and tables.
    What is the best approach now?
    Rick
    Rick_Yurick@adobeforums.com Guest

  2. #2

    Default Re: Make alternate Rows of text Bold

    It would be a piece of cake in ID CS2. Set up paragraph styles for bold
    and non bold text. Have each as the next style from the other and then
    just apply the style and next style.

    For ID CS you'll likely need a script.

    Bob
    Bob Guest

  3. #3

    Default Re: Make alternate Rows of text Bold

    Try this script:

    for(var i = 0; i < app.selection[0].lines.count(); ++i)
    if(i % 2 == 0)
    app.selection[0].lines[i].fontStyle = "Bold";

    The previous makes first line Bold and then alternates. If you want
    second line Bold, and then alternate, use:

    if((i+1) % 2 == 0)

    pepsi_cola40@hotmail.com Guest

  4. #4

    Default Re: Make alternate Rows of text Bold

    Oh my, I must be really tired. The code I gave you works, but is badly
    designed. The following would be more efficient:

    for(var i = 0; i < app.selection[0].lines.count(); i += 2)
    app.selection[0].lines[i].fontStyle = "Bold";

    This makes first line of selection Bold then alternates. To make second
    line Bold and alternate:

    for(var i = 1; i < app.selection[0].lines.count(); i += 2)
    app.selection[0].lines[i].fontStyle = "Bold";

    pepsi_cola40@hotmail.com Guest

  5. #5

    Default Re: Make alternate Rows of text Bold

    So would you make each line into a paragraph?

    With InDesign's type composer I don't see how you would do it on a line
    by line basis.
    Simon Guest

  6. #6

    Default Re: Make alternate Rows of text Bold

    I think Bob was thinking this was a table, where this process is done commonly. Do you mean you have paragraphs of text, where you want alternate lines in bold and light text?
    Don_McCahill@adobeforums.com Guest

  7. #7

    Default Re: Make alternate Rows of text Bold

    No, Bob was assuming each line was a paragraph and was referring to the new feature in CS2 where you can apply to a range of text paragraph styles taking the "next style" setting into account.

    Dave
    Dave_Saunders@adobeforums.com Guest

  8. #8

    Default Re: Make alternate Rows of text Bold

    Dave has it right. That is what I was assuming from the description. If
    the lines are within a paragraph, then you've got a real job on your
    hands since bolding will likely result in a line wrap.

    Bob
    Bob Guest

  9. #9

    Default Re: Make alternate Rows of text Bold

    Guys,
    I am lucky in that it is a price list with varying numbers of columns and wrapping shouldn't be a problem.
    And I haven't got CS2 yet.
    Any ideas on the script method?
    Rick
    Rick_Yurick@adobeforums.com Guest

  10. #10

    Default Re: Make alternate Rows of text Bold

    If you make a style for the bold text and select the text that has to be handled, this will do it:


    boldstyle = app.activeDoent.paragraphStyles.item('Bold');
    thetext = app.selection[0].texts[0];
    for (i = 0; i < thetext.lines.length; i+=2){

    thetext.paragraphs[i].appliedParagraphStyle = boldstyle;
    }


    I called the paragraphstyle 'Bold'. If it has another name, change line 1.

    Teus
    Teus_de_Jong@adobeforums.com Guest

Similar Threads

  1. how do i make alternate text for a hyperlink
    By WHA68 in forum Web Design
    Replies: 2
    Last Post: March 25th, 02:14 PM
  2. rows in a datagrid in bold based on the value of a field
    By ALI-R in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: November 2nd, 08:08 AM
  3. alternate rows in Datalist with repeated columns
    By Joe Abou Jaoude in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 18th, 09:42 AM
  4. text member text bold hilight
    By harnoors webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: September 11th, 09:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139