Search does not start at beginning
Manan Joshi kindly write a script to copy sequential lines from an input text file into a document. I have used the script a number of times with no problems.
The script and the discussion can be found here.
I am currently working on a file with 3,644 footnotes each with the dummy text "¢†". I would like to sequentially replace each placeholder with a line from an input file.
The problem is, no matter what I do, the script starts at footnote 18. So, input-line-1 maps to footnote 18, not footnote 1 and so the whole copy and paste is out of sequence.
How can this behaviour be fixed?
I have tried the following:
- delete first frame of story, create new text frame, then re-thread
- delete first footnote, then replace again (which did have the effect of searches within InDesign starting from the first footnote, but not so when using the script)
- saving a copy of the document and then trying again with the copied document.
- I have tried both the version of the script which uses "var res = app.selection[0].parentStory.findGrep(true)" in line 11 and the version that has "var res = app.documents[0].findGrep(true)"
- I have tried starting the script with my cursor in different positions: in the story, in the footnote, nothing selected
I am posting a new thread because I think the problem may be more general than the way the script linked above works.
Thank you!