/ Id-Extras Forum / Remove Dropwords
September 13, 2022 at 9:08 pm #6973Yosef 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 helpSeptember 14, 2022 at 3:05 am #6974~~Ariel~~Participant
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.
ArielSeptember 14, 2022 at 8:42 am #6976Yosef Wexler
“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.September 14, 2022 at 11:38 pm #6979~~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.September 15, 2022 at 1:46 pm #6980Yosef Wexler
I think this should work:
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.October 22, 2023 at 12:50 pm #7562RaphaelParticipant
I have the same problem but I haven’t run a cleanup script so why does it happen?October 22, 2023 at 1:03 pm #7563ArielKeymaster
(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)?October 22, 2023 at 1:10 pm #7564RaphaelParticipant
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?October 22, 2023 at 9:51 pm #7566ArielKeymaster
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?October 23, 2023 at 9:40 am #7569RaphaelParticipant
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.October 23, 2023 at 10:35 am #7571ArielKeymaster
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.October 23, 2023 at 11:24 am #7572RaphaelParticipant
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.October 25, 2023 at 9:22 pm #7599ArielKeymaster
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.October 26, 2023 at 9:08 am #7600RaphaelParticipant
I hear you.