I'm trying to figure out if there's been a change with InDesign CC 2021, or if there's something else at play. We have a script that used to take delete a line of text and replace with a space - it is leaving the line in now:
Hi @Sally5C0E, I tested that code and it worked as expected for me (replaced the findWhat text with nothing). Here's the exact code I tested:
var doc = app.activeDocument, selectedText = doc.selection; app.findGrepPreferences.findWhat = "ALL CONTENT MUST BE AFTER THIS LINE - DO NOT REMOVE"; app.changeGrepPreferences.changeTo = ""; selectedText.changeGrep();
Are you getting an error? Have you double-checked the findWhat string does match the document text? Perhaps you could post a sample document?
Thanks @Sally5C0E. I tested by importing your .rtf file and it works as expected (Indesign 17.2.1, MacOS 12.3.1).
Could you please make a new document, import .rtf file and test your code? And if it doesn't work with that, please post that indesign file that fails? And your test code? Then we can get to the bottom of it.
We have to use InDesign V 16. I just did an update to 16.4.2 and it is working again. Thanks for looking into this!
Okay glad it's working. 🙂 Glitches are sometimes fixed by updating.