Copy link to clipboard
Copied
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:
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!
Copy link to clipboard
Copied
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[0];
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?
- Mark
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
- Mark
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Okay glad it's working. 🙂 Glitches are sometimes fixed by updating.
- Mark