Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 15 posts - 316 through 330 (of 372 total)
  • Author
    Posts
  • in reply to: swap text with specific paragraph style #88518

    Did you copy everything from the forum. It works here correct with your example. In line 9 it should be p=0 instead of p=)
    Otherwise your document is needed.

    in reply to: swap text with specific paragraph style #88510

    Your second example is well prepaired, thank you. Then: All Caps is set to ‘City’, but not to ‘Listing’.

    So I decide to compare the acutal applied paragraph style with the style of the previous paragraph.

    Try this one:

    (function () {
      var curDoc = app.documents[0],
      allParas = curDoc.stories.everyItem().paragraphs.everyItem().getElements(),
      p,
      curPara,
      prevPara,
      pStyleName;
    
      for (p = 0; p < allParas.length; p++) {
        curPara = allParas[p];
        prevPara = allParas[p-1];
        pStyleName = curPara.appliedParagraphStyle.name;
        if (pStyleName == "COMPANY NAME" && (prevPara.appliedParagraphStyle.name == "LISTING TYPE" || prevPara.appliedParagraphStyle.name == "Listing type no space")) {
          allParas[p].appliedParagraphStyle = "COMPANY NAME - No space above";
        }
        else if (pStyleName == "LISTING TYPE" && allParas[p-1].appliedParagraphStyle.name == "CITY") {
          allParas[p].appliedParagraphStyle = "Listing type no space";
        }
      }
    }());
    
    
    Kai
    in reply to: swap text with specific paragraph style #88508

    Haha, your example doesn’t really help ;-)

    First of all, you should have started a new thread for this, but anyway:

    1. The first paragraph have Basic Paragraph applied, not city …
    2. Why not simply change the styles and remove the space above?
    3. Are you sure, that everything is in All Caps? So, check the icons between city and listing type!

    I assume, that you have places, where space above is needed. But where is your example? What should be changed, and what should not be changed?

    Kai

    in reply to: swap text with specific paragraph style #88502

    It’s not clear to me, where and how there is space. So please provide a idml file before/after, with some entries, that we can inspect your data.

    Kai

    in reply to: GREP change font just a part of a word? #88501

    Hi Tommy,

    in this case, you need a so called lookahead, that find the position of your second phrase, but does not include the characters as a found.

    info(?=name) OR (?=infoname)info

    Kai

    in reply to: Make everything bold before (and included) a colon using GREP? #88368

    Everything from start included the colon:

    ^[^:]+:

    Everything from start excluded the colon:

    ^[^:]+

    The GREP find the beginning of a paragraph, followed by anything, that is not a colon, one or multiple times, followed by a colon (first case) or not (second case)

    Kai

    in reply to: GREP Styles problem #88113

    So, problem solved with your solution?

    The grep for small caps could be a bit shorter:

    ^.\K(([\w.,']+)\x20){3}[\w.,']+

    If not: The trick is, to deactivate ‘ordinals’ in the smallCaps cStyle and let small caps begin on the second character.

    in reply to: Delete Specific Layer #88110

    Hi Kathy,

    this should work for all open docs:

    app.documents.everyItem().layers.itemByName("test").remove();
    
    in reply to: Applescript question: Deleting empty column from table #87865

    Aaron, this isn’t true, but we speak Javascript instead of Applescript! ;-)

    Kai

    in reply to: Header, Row and Column Size #87864

    Hi Brendan,

    try this one:

    var allTables = app.activeDocument.stories.everyItem().tables.everyItem();
    allTables.rows.everyItem().height = 5.5;
    allTables.columns.everyItem().width = 15;
    allTables.rows.firstItem().height = 12;
    

    It will not check, if the first line is a real header-row. It will give the height to all first lines.
    Realize also, that you get maybe overset or the textframe is not fitting the table.

    Kai

    in reply to: GREP: Lookahead question #87582

    No. ‘\x20’ is the shortcut for \x{0x20}. This is another way to notate the unicode-value of a normal space. You can see this, if you select a space and read the value in the information panel.

    While includes all kind of whitespace, the tab, a shift return and a return, \x20 will find only simple spaces :)

    in reply to: GREP: Lookahead question #87551

    The first ones should be

    ~8\x20(.)

    To your explanation on #2: It looks not to the first character of the next paragraph, since lookararounds find only positions and not characters.

    in reply to: GREP: Lookahead question #87546

    Hi Aaron,

    this can be done in two steps!

    1. Remove manual bullets
    Find what: •\x20(.)
    Change to: $1 + applied bullet style

    … will find a bullet, followed by a space, followed by any character (the any character is needed, because you can either apply formatting or change something >> with this trick you can do both in one go!)

    2. Find the last bullet para
    Find what: \r(?!.) + applied bullet style
    Change to: nothing + + applied bullet last style

    … will find a return with applied style bulletStyle, if it is not followed by a character with the same formatting. So it will find the last return in a range.

    best
    Kai

    in reply to: Maintaining paragraph styles with updated .rtf #87320

    From a technical point of view, there is no ‘simply update a file’. InDesign will place this file, as if it were never in your document.

    So the idea is:
    1. Create a template with styles in InDesign
    2. Export a file to rtf
    3. The texter write in this file and use your styles
    4. Update your file

    If the texter use your styles and you did nothing in your document, you should get the right result.

    If you want a bit more comfort, you should try wordsflow from emsoft.

    Also I can recommend Anne Maries Title on InDesign/Word-Workflow at Lynda.com.

    Kai

    in reply to: GREP Find space before one or more numbers #87316

    No, it’s like learning how to play guitar. If you understand some concepts, you will be able to play your own songs.

    \x20 is the unicode value for a space-character. It’s a way to make spaces visible in your code. You can check that, if you select a space and read the value in the Information-panel. This will show you ‘0x20’. So you could write \x{0x20} or in this case the shortcut \x20

Viewing 15 posts - 316 through 330 (of 372 total)