To reproduce: Create a textbox with some text in it. Don't do any formatting of the text. Select it and run the script. It will make two copies: the first will be empty, the second, after the richContents property is deleted, will be the same as the original.
Code: Select all
var a = this.selectedAnnots[0].getProps();
a.rect = [a.rect[0]-20,a.rect[1]-20,a.rect[2]-20,a.rect[3]-20]; // move over 20pt
this.addAnnot(a); // this one will be blank
if ( ! a.richContents.length ) { // ie the richContents are empty
delete a.richContents; // workaround for empty richContents bug
}
a.rect = [a.rect[0]-20,a.rect[1]-20,a.rect[2]-20,a.rect[3]-20]; // move over 20pt
this.addAnnot(a); // this one is fine