multiple findTextPreferences in a loop


hi

 

i make multiples finds tag characters (italic, bold, allcaps, smallcaps, underline...). so, i'm creating array, trying store findtextpreferences , using in "for" loop.

 

i've try different writing nothing works.

 

store :

carafindprefs[0][0] = "app.findgreppreferences.fontstyle = 'italic'"

use in "for" loop :

eval(carafindprefs[i][0]);

 

store :

carafindprefs[0][0] = "fontstyle"

carafindprefs[0][1] = "bold";

use in "for" loop :

app.findgreppreferences.eval(carafindprefs[i][0]) = carafindprefs[0][1];

or that

app.findgreppreferences.carafindprefs[i][0] = carafindprefs[0][1];

...

 

do have advice ?

 

seb

hi,

 

try following lines:

 

 

var curdoc = app.activedocument;    var cstylelist = [      ["italic", "italic"],      ["bold", "bold"]  ];   ( var j = 0; j < cstylelist.length; j++ ) {      app.findgreppreferences = app.changegreppreferences = null;       app.findgreppreferences.fontstyle = cstylelist[j][0];       app.changegreppreferences.appliedcharacterstyle = cstylelist[j][1];       curdoc.changegrep();   }   app.findgreppreferences = app.changegreppreferences = null; 


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP