Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

search a word between "( )" and apply CharacterStyle

$
0
0

sorry my bad english

 

I need your help,

 

I can search within a parenthesis with \((.*)\)

 

ex:  hello (world) bye, need apply a CharacterStyle to "(world)" with  CharacterStyle


hello (world) bye

 

similar script:

 


var active_doc = app.activeDocument;  
var search_string = /\((.*)\)/ig; 
var text_frames = active_doc.textFrames; 


var italicStyle = active_doc.characterStyles["italica"]; 


if (text_frames.length > 0) 
{     for (var i = 0 ; i < text_frames.length; i++)       {           var this_text_frame = text_frames[i];     italicStyle.applyTo(this_text_frame.textRange);                        if (new_string != this_text_frame.contents)                {                     this_text_frame.contents = new_string;                }       } 
} 

 

 

thanks, sorry my bad english I speak spanish


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>