1 person found this helpful
Well, presuming the user has selected some text, and to make sure it's a number:
myNumber = Number(app.selection.contents);
// Do a calculation
myNumber = myNumber + 5;
// Replace the selection
app.selection.contents = myNumber;
That's the basic skeleton of your script, I suppose...
2 people found this helpful
app.selection.contents = String (myNumber);
Thanks a lot for your suggestion, it works and I am on my way.