/ Id-Extras Forum / Remove Dropwords

  • Author
  • #6973 Reply
    Yosef Wexler

      First of all great script!

      Extremely helpful and works great most of the time.

      Recently was using the “remove dropwords” function and all of a sudden I noticed that where the linebreak and tab were being removed it wasn’t putting in a space there and I was ending up with two words now being combined into one. I’m pretty sure this isn’t the first time I’ve used the remove dropwords function and don’t recall that happening in the past.

      This obviosly is not what’s supposed to be happening.
      Am I doing something wrong in the way I’m running “remove dropwords”?

      Thanks for your help

      #6974 Reply
      ~~Ariel~~
      Participant

        Hi Yosef,
        Thanks!
        When you run Dropword, it adds (inserts) a forced line break followed by a tab at the end of the line. (Well, the forced line break is at the end of the line, and obviously the tab as at the beginning of the next line.)
        When you run the “Remove” command, it removes the forced line break and tab.
        It does not replace them with a space, because it did not delete any spaces.
        So the result is that the text returns to its original state. Try this on a new file with new text, and you’ll see how it works.
        If you’re finding that there’s a space missing after running “Remove”, my guess is that that’s because you ran a find/change that removes all spaces at the end of the line, something like that. Could that be?
        Or else at some point you manually deleted those spaces.
        In any case, if those spaces are really missing, you could simply run your own find/change in InDesign. Search for a forced line-break followed by a tab, and replace with a space.

        Ariel

        #6976 Reply
        Yosef Wexler

          Thanks!!

          “If you’re finding that there’s a space missing after running “Remove”, my guess is that that’s because you ran a find/change that removes all spaces at the end of the line, something like that. Could that be?”

          That’s EXACTLY what had happened, unintenionally of course.

          I tested out a new file and discovered if after running Dropword you use InDesign’s built in GREP of “Remove Trailing Whitespace” that will erase the space before the linebreak.
          That must have been what I had done and was then afterwards using “remove dropword” and getting words together.
          Thanks for your help, now I know to me more careful about using “remove trailing whitespace” after Dropword.

           

          #6979 Reply
          ~~Ariel~~
          Participant

            Great, glad you figured it out.
            So, yes, one needs to a find a way to modify that GREP to exclude spaces before forced line breaks.

            #6980 Reply
            Yosef Wexler

              I think this should work:

              Find \s+\r

              Change \r

              If you put in the \r instead of the $ which ID has in there it doesn’t find spaces before line breaks.
              Only thing is since \r isn’t a location like $ you need to in the change but back in the paragraph mark \r if not you’ll end up with paragraphs grouped together.

              Not sure if anything else the built in “remove trailing whitespace” is finding which is missing in above GREP.

               

              #7562 Reply
              Raphael
              Participant

                I have the same problem but I haven’t run a cleanup script so why does it happen?

                #7563 Reply
                Ariel
                Keymaster

                  Hi Raphael,
                  (I haven’t had a chance to look at the screen recording you sent privately yet.)
                  Before running the “remove dropwords”, can you confirm that a space does indeed exist between the two words, apart from the shift-Enter and Tab that Dropwords adds (and deletes, when you run the remove dropwords routine)?

                  #7564 Reply
                  Raphael
                  Participant

                    The space isn’t there. I guess some cleanup was done after the drop caps were applied. Perhaps the script should take that into consideration?

                    #7566 Reply
                    Ariel
                    Keymaster

                      Hi Raphel,
                      I had a look at the screencast you sent, and took a screenshot from it:

                      You’ll notice that (even before removing the dropword) there is no space between שהכל and נהיה (the lower red box). Whereas there is a space between חדשים and בסימן (as per the top red box).

                      So it does seem that somehow, during the course of typesetting, the original space between those two words has gone missing. So when you click to remove the dropword from that bottom paragraph, there is no space between the two words, since Dropword doesn’t add or remove any actual spaces – it just adds a forced line break + tab at the end of the line, or removes it if you cancel the dropword. If a word space exists, it leaves it alone, and if there is no word space, it does not add one.

                      Does that make sense?

                      #7569 Reply
                      Raphael
                      Participant

                        Yes, I saw the issue. I understand that if I run dropwords and then clean up text after, then I have an issue. The question is perhaps dropwords can be cleverer? It’s a simply grep search to add a space before removing dropwords and perhaps the software should be a little smarter rather than relying on the user not to clean up text after using dropwords.

                        #7571 Reply
                        Ariel
                        Keymaster

                          To get Dropword to add a space when it removes the Dropword isn’t a problem. But it could mess the text up pretty badly if it did that! For instance, what if the word on the previous line ends with a maqaf?
                          By the way, when Dropword removes the dropword, all it’s doing is searching for a manual linee break followed by a tab and deleting them (I can’t remember offhand if it applies a special “marker” character style to that combination to make it easier to find afterwards; I think not). You could do exactly the same manually with find/change. So if you wanted to, you could save your own find/change and replace with a space rathen than with nothing.

                          #7572 Reply
                          Raphael
                          Participant

                            Yes, you are right in terms of a makaf but I’m guessing that might be the only problematic character which could be accounted for.

                            Alternatively, you could have put in a “marker” in the script to start with to avoid that too.

                            Also, you are right that I could do that manually, however, I have various clean up scripts that have hundreds of search and replaces. Asking the user to update their workflow to compensate for a script is one approach, but making the script more robust to start with has value too.

                            #7599 Reply
                            Ariel
                            Keymaster

                              Hi Raphael,

                              I understand from what you’re saying that you’ve got a cleanup routine that removes spaces before a forced line break?

                              If you’re using Dropwords much, it probably is worthwhile to update that particular script to not delete a space before a forced line break followed by a tab.

                              I can’t see myself getting the script to add a space whenever it removes dropwords. Apart from the issue with a maqaf, the script can be used for all languages (including LTR ones) and there might be many more exceptions like maqafim when all those languages are taken into account.

                              #7600 Reply
                              Raphael
                              Participant

                                I hear you.

                              Viewing 14 posts - 1 through 14 (of 14 total)

                              Tagged: 

                              Reply To: Reply #6979 in Remove Dropwords
                              Your information: