• You must be logged in to reply to this topic.Login

find the words at eh end of each column which does not end with something.

Return to General InDesign Topics (CLOSED)

  • Author
    Posts
    • #56551
      Anonymous
      Inactive
      Is it possible to find words at the end of each column that does not end with a space, forced line break, or a hyphen?
    • #56552
      Anonymous
      Inactive

      Not with any means within indesign – this would have to be a script.

    • #56565
      Anonymous
      Inactive

      I would like to know how to find what I want to with Scirpt.

      I hvae lots of documents and the document has so many pages.

      It would be very appreciate if you Let me know how to find with sciprt!

    • #56566
      David Blatner
      Keymaster

      You could probably find a way to re-work the script found here:

      https://creativepro.com/for…..underlines

    • #56592
      Anonymous
      Inactive

      Thank you for your tip and I apply your script to my own's

      In my case, It is the same finding words at the end of each column that does not end with a space, forced line break, or a hyphen) as finding the regular expression [a-z] at the end of each column .

      I change my thought to fine the [a-z] at the end of each column and underline those.

      So I setup the belows script. But it doesn't works.

      I am the beginner of the scirpt. Please help me.

      //DESCRIPTION: Begone, Ugly End Of Line Underlining!
      // (c) Jongware 16-Dec-2009

      var blankStyle = app.activeDocument.characterStyles.item(“Underline”);

      try { blankStyle.index; } catch(_)
      {
      blankStyle = undefined;
      }

      if (blankStyle == undefined)
      {
      blankStyle = app.activeDocument.characterStyles.add();
      blankStyle.name = “Underline”;
      blankStyle.underline = true;
      }

      var myDocument=app.documents.item(0);
      var findWhat=”[a-z]”;
      app.findGrepPreferences=NothingEnum.nothing;
      app.changeGrepPreferences=NothingEnum.nothing;

      app.findGrepPreferences.findWhat=findWhat;
      var myFoundItems=myDocument.findGrep();

      for (a=0; a<app.selection[0].lines.length; a++)
      {
      if (app.selection[0].lines[a].characters.item(-1).contents == myFoundItems)
      app.selection[0].lines[a].characters.item(-1).appliedCharacterStyle = blankStyle;
      }

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads