Macro: format text and italicize
Posted: 2013-10-15 23:24:13
The attached macro (thanks, Philip!) does what I need in one case, but not in another.
It is supposed to apply a Character Style "EC-Titles and acrostic letters" (which is to have a font size of 10) to text in <<double arrows>> and then delete the arrows themselves.
It is also supposed to change all text in [brackets] to italics and delete the brackets.
If there is indeed some text in <<double arrows>>, then the macro seems to work correctly, whether or not the text in double arrows comes first in the file or not.
However, if there is no text at all in double arrows, the macro applies the Character Style to the text that was in italics.
I've studied the macro and tried to figure it out, but I can't tell why it's doing that.
Text that is processed properly (note "[test]" and "<<Test.>>"):
Text that is not processed properly:
It is supposed to apply a Character Style "EC-Titles and acrostic letters" (which is to have a font size of 10) to text in <<double arrows>> and then delete the arrows themselves.
It is also supposed to change all text in [brackets] to italics and delete the brackets.
If there is indeed some text in <<double arrows>>, then the macro seems to work correctly, whether or not the text in double arrows comes first in the file or not.
However, if there is no text at all in double arrows, the macro applies the Character Style to the text that was in italics.
I've studied the macro and tried to figure it out, but I can't tell why it's doing that.
Text that is processed properly (note "[test]" and "<<Test.>>"):
Code: Select all
$$ Ro 1:8
Ziiwizxziz zz xzxxix zzxx Zizxxi xzi Jzzx Ziizix xz ixz xizxz, xzx {„zxiz ixzx iixziiwz zxzixizwz“ – zixz „ixzx iixziiwzz zxzixizwzz“}[test] ixzx iixziiwz zxzixizwz xizzwz xzzzxixiz.
$$ Ro 1:9
Zzz <<Test.>> Zizxzz, xxiizw zz izixzxix zzxx xxzziz ix Zxxzxz zxzxxziiixiz, xiz wzxx iixxxixizz, xzix xz xziixxxz wixix ixz zzxx wzixxzz xizxxwzi
Code: Select all
$$ Ro 1:8
Ziiwizxziz zz xzxxix zzxx Zizxxi xzi Jzzx Ziizix xz ixz xizxz, xzx {„zxiz ixzx iixziiwz zxzixizwz“ – zixz „ixzx iixziiwzz zxzixizwzz“}[test] ixzx iixziiwz zxzixizwz xizzwz xzzzxixiz.
$$ Ro 1:9
Zzz Zizxzz, xxiizw zz izixzxix zzxx xxzziz ix Zxxzxz zxzxxziiixiz, xiz wzxx iixxxixizz, xzix xz xziixxxz wixix ixz zzxx wzixxzz xizxxwzi