I'm revisiting an issue I first posted here last summer, thanks to all who offered help, but I've not been able to sort it out.
http://forums.adobe.com/thread/455526?tstart=0
What I'm after is a 'search function' to insert into a FindChangeByList.
Jongware suggested the following - but when inserted into my list I can't get it to do anything - it doesn't throw up a Javascript error.
app.findTextPreferences = NothingEnum.nothing;
app.findTextPreferences.appliedParagraphStyle = "Callout_3";
foundItems = app.activeDocument.findText();
for (var i=foundItems.length-1; i>=0; i--)
{
if (foundItems[i].paragraphs[0].lines == 2)
foundItems[i].paragraphs[0].appliedParagraphStyle = "Callout_2";
if (foundItems[i].paragraphs[0].lines == 1)
foundItems[i].paragraphs[0].appliedParagraphStyle = "Callout_1";
}
I regularly receive a 'word' document on which I run a 'FindChangeByList' which cleans up and formats the text with a number of GREP/text searches.
One of the search lines converts a particluar string of text to a paragraph style "Callout_3" (the most common occurence of Callouts).
This style applies a paragraph rule, above and below the line, to create a coloured block/band out of which said text is reveresed.
The problem that I have is that the style (because of the paragraph rules), only works correctly if the paragraph has x3 lines of text.
I have styles set up for every other eventuality - Callout_1 (for single line of text), Callout_2 (for x2 lines of text) etc.
What I'm looking for is a script that can count the number of lines in the paragraph (once the "Callout_3" style has been applied) and then change the style accordingly to the number of lines in each paragraph/Callout.
Any further thoughts?
Steve