Just a last thing, in the script you gave me I would like to add a static text in order to have "CH. 001"
when my text is "1".
Exemple if I duplicate a lot of "1" I will have "CH. 001", "CH. 002", "CH. 003", "CH. 004".
It would be so perfect if you could solve my problem !!
Thank you again
Yep have a try with this one:
/**
* Increments the contents of first
* selected text frame and sets contents
* of subsequent selected text frames
* according to counter.
*/
(function () {
// prefix of each number
var prefix = "CH. ";
// the length of number
var len = 3;
var doc = app.activeDocument,
items = app.selection;
for (var i = items.length - 1, n; i >= 0; i--) {
if (items[i].constructor.name == 'TextFrame') {
if (n == undefined)
n = Number(items[i].contents.replace(/\D/g,''));
items[i].contents = prefix + ('000' + (++n)).slice(-len);
}
}
})();