Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28350
    spiros
    Participant

    I have a .jsee macro which makes various transformations on text and I want to specifically target part of this text for some find/replace operations.

    For example, this could be the full text:

    Kyrgyz: укта; Lao: ນອນ; Latgalian: gālēt; Latin: gālēt, gulēt; Latvian: gulēt, dusēt; Lenape Unami: kawi; Limburgish: slaope; Lithuanian: miegoti; Livonian: maggõ;

    And I would like to perform some character replacements only on the words/phrases contained in the Latin language section (Latin: gālēt, gulēt;). without affecting any other text, even if there is a match. (Languages are delimited with “;”) For example, I would like to apply these operations:

    // Remove Latin accents
    document.selection.Replace("ā","a",eeReplaceAll,0);
    document.selection.Replace("ē","e",eeReplaceAll,0);
    document.selection.Replace("ī","i",eeReplaceAll,0);
    document.selection.Replace("ō","o",eeReplaceAll,0);
    document.selection.Replace("ū","u",eeReplaceAll,0);
    document.selection.Replace("ȳ","y",eeReplaceAll,0);
    #28351
    spiros
    Participant

    I think I got it

    document.selection.Find("Latin: (.*?);",eeFindNext | eeFindReplaceRegExp | eeFindMatchDotNL | eeFindSelectAll,0);
    document.selection.Replace("ā","a",eeFindReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp | eeFindMatchDotNL,0);
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.