10 Replies Latest reply on Apr 19, 2016 4:15 AM by pierrek27606136

    upper to lower in selected text

    gert verrept Level 2

      //Change THIRD character to lower case

      //Peter Kahrel wrote the original of this.


      app.findGrepPreferences = app.changeGrepPreferences = null;

      app.findGrepPreferences.appliedParagraphStyle = "List";


      // Third letter in paragraph to lower case:

      app.findGrepPreferences.findWhat = "^.{3}";

      found = app.activeDocument.findGrep();

      for (i = 0; i < found.length; i++)

        found[i].characters[2].changecase (ChangecaseMode.lowercase);


      The script above (modified by Peter) works very well (ID CC), but could it be possible to make it work on a selected text instead of on paragraph level? because we cannot always change the paragraph style name (again due to exporting txt to other applications).

      To be clear: Select text and run script for the selection.