-
1. Re: [JS] Handling a result of a search
Dirk Becker Feb 13, 2011 6:39 AM (in response to Philippe Ruelle)Given a javascript string, the following code works for me:
alert("abcabc".replace(/[ab]/g,function (a1) { return a1.toUpperCase()+"!"; }));
The example script "FindChangeByList.jsx" has plenty code to borrow if you mean InDesign's grep search on the full text model.Dirk -
2. Re: [JS] Handling a result of a search
Philippe Ruelle Feb 13, 2011 9:08 AM (in response to Philippe Ruelle)Mon problème, aucun paramètre est passe à la fonction "convertionTableau()"
Traduction
My problem is no parameter to pass the "convertionTableau()"
Thank you
function rechercheTableau(texte) {
var lesBaliseTableau= '<ParaStyle:INB>.+?';regex = new RegExp(lesBaliseTableau,'g');
texte.replace(regex,convertionTableau()); // le problème est là!
return(texte);
} -
3. Re: [JS] Handling a result of a search
Dirk Becker Feb 13, 2011 9:20 AM (in response to Dirk Becker )If that was too dense, let's decompose the source.
var text = "abcabc";
var RE = /[ab]/g;var RE = new RegExp("[ab]","g"); // alternative notationfunction convert(a) {return a.toUpperCase()+"!";;}var result = text.replace(RE,convert);alert(result);Dirk -
4. Re: [JS] Handling a result of a search
Philippe Ruelle Feb 13, 2011 9:59 AM (in response to Philippe Ruelle)Merci
le problème était de mettre les parenthèses à l'appel de la "fonction"
Traduction
Thank you
the problem was to put the parentheses to call the "function" -
5. Re: [JS] Handling a result of a search
pkahrel Feb 13, 2011 12:09 PM (in response to Philippe Ruelle)I think that Philippe's problem is that he uses the wrong kind of notation for a hex character. Instead of  use \u0016.
Peter
-
6. Re: [JS] Handling a result of a search
Philippe Ruelle Feb 14, 2011 10:40 AM (in response to pkahrel)Merci c'est le bon tag, je convertie un fichier 3B2 pour Indesign.
un très grand merci
Traduction
Thank you this is the right tag, I converted a file to Indesign 3B2.
a big thank you



