1 person found this helpful
Nope! I've often wished for something like that -- not just in scripting, but in the UI as well.
but thanks anyway
@LeftHand – you mean: find everything but italic?
No, I don't think this is possible with findTextPreferences.
You could target the whole scope (a Story, a TextFrame etc.pp.) and its texts object and weed out all characters, that are not formatted in italic. Cumbersome and slow.
If no nested styles are used (if no GREP Styles in paragraph styles, or Nested Styles in paragraph styles are used) you could use text style ranges as atoms for your search and check for the fontStyle definition.
"Cumbersome and slow."
I can imagine that it could be optimized quite a lot. For instance, find all italics, get the start and end insertionPoint index of all those finds, then get the start and end index of the Story in questions. Then with simple maths get an array of references to the ranges of all insertionPoints that are not formatted with italics.
I think that would be pretty quick, because usually reading values from the DOM (such as getting the index of a given insertionPoint) is pretty quick.
@Ariel – of course, that's a good idea. I would not want to do something like this with a TEXT or GREP search…
@Uwe - @Ariel - I love you
With your answers from this post and the other one on cutting textStyleRange between each paragraph, you give me the idea to solve my nested Xml problem (http://forums.adobe.com/thread/1427250?tstart=0) . +10000 for both of you