Reply To: Character Style Automation for Foreign words

#67146
Masood Ahmad
Participant

Hi Abbas, I have tried to write a code to minimize the manual work and have included the basic latin characters used normally. I have not taken the complete list of special characters. Try to populate the GREP code to work wonders. As I said earlier that the code has been tested on CS5, but that was on MAC, however, I test the code at home on ME and tweaked it a little. Please check the InDesign file which contains the Urdu text, paragraph style and a character style:

https://ftf-1118.yousendit.com/download/1/E3E436DE339849CE/65b7b44b39ab98da7ac1e91a4677bd9289763147/R2L-ParaStyle-With-L2R-CharStyle.indd?download_id=4710108915&user_locale=en&id=2227692811&ufid=E3E436DE339849CE&file=R2L-ParaStyle-With-L2R-CharStyle.indd

The tweaked codes are also listed below:

Code1:
([\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}])+

Code2:
([!”‘()-./\:;<=>\[\]^_`~\{|\}]+(?=[\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}]))+

Code3:
((?<=[\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}])[!”‘()-./\:;<=>\[\]^_`~\{|\}]+)+

Code4:
([\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}]|[!”‘()-./\:;<=>\[\]^_~\{|\}])([\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}]|[!"'()-./\:;<=>\[\]^_~\{|\}])

Apart from this, you can apply the character style manually on the left overs. Please let me know if you got something better.

This article was last modified on February 12, 2014

Comments (0)

Loading comments...