I don't know if that's the way do go about it but this is what you are looking for.
myParagraph=app.selection.paragraphs; myText=myParagraph.characters.itemByRange(0,myParagraph.contents.toString().indexOf("\t")); myText.remove();
To delete until the tab not including it use myText=myParagraph.characters.itemByRange(0,myParagraph.contents.toString().indexOf("\t") -1);
Message was edited by: ~ Trevor ~
that's how i did it, but i think it's kind of a very ugly hack.
Also text.contents already returns a string, so no need for .toString();
The .toString() is a bit safer.
Try the script with the first line
It works with the toString and doesn't without.
So it depends on how you define myParagraph
But as you wrote myParagraph and not myParagraphs you probably don't need the toString()
.everyItem() returns a array of paragraphs, so ofcourse it doesn't work. Anyway the paragraph part was a simplification. The actual code i needed was:
I had to make a script to change/restart the footnote numbering on a "per frame" basis.