-
1. Re: How to asign a character style to conditional text?
Jump_Over Nov 22, 2014 11:05 AM (in response to camilo umana)Hi,
Disable lines 10-16 if conditional text is not a goal.
Define mCStyle and
Modify line 29:
//... mFound[len1].appliedCharacterStyle = mCStyle; //...
Jarek
-
2. Re: How to asign a character style to conditional text?
camilo umana Nov 22, 2014 11:43 AM (in response to Jump_Over)Hi,
(I posted in the original script as it seems something is wrong when some phonemas are defined in the text list)
Perhaps my syntax got wrong in line 22
mFound[len1].appliedCharacterStyle = ITAL;
var
mDoc = app.activeDocument,
mCond = mDoc.conditions.item("mFound"),
mPath = "~/Desktop/list.txt",
mDelimiter = ",",
mSource = File(mPath),
mOpen = mSource.open("r",undefined,undefined),
len, len1, mWordsArr, mFound;
if ( !mOpen) {alert ("Can't open a source file"); exit()};
mWordsArr = mSource.read().split(mDelimiter);
len = mWordsArr.length;
app.findTextPreferences = null;
while (len-->0) {
app.findTextPreferences.findWhat = mWordsArr[len];
mFound = mDoc.findText();
len1 = mFound.length;
while (len1-->0)
mFound[len1].appliedCharacterStyle = ITAL;
}
app.findTextPreferences = null;
-
3. Re: How to asign a character style to conditional text?
Jump_Over Nov 22, 2014 6:50 PM (in response to camilo umana)Hi,
Is ITAL the name you can see in Char Style Panel?
Use quotation ==>
mFound[len1].appliedCharacterStyle = "ITAL";
Jarek
-
4. Re: How to asign a character style to conditional text?
camilo umana Nov 23, 2014 1:21 AM (in response to Jump_Over)Jarek, yes now is fine. I omitted the strict code of quotations.
Thanks for your time. This script is haute cuisine...



