Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: insert or replace last content

$
0
0

there are multiple problems with your code.

For one, what if you don't have any punctuation at the end of the list? per your example:

• vamitul;

      • vamitul;

      • vamitul                      /// your code will change this line to vamitu.

Dummy text parag

 

 

as for your example, you have to test if that paragraph is the last one in the story (for example myResults[n].parentStory.paragraphs.nextItem(myResults[n].paragraphs[ 0]).isValid  will test if there is another paragraph after your found one). if it is the last one, you will have to treat it as a special case and adjust the insertionPoints range.

also using insertionPoints is not the most fortunate idea.. (see my point above). instead do a changeGrep() on the found text.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>