5 Replies Latest reply on Jun 20, 2014 4:30 AM by HarveyLiu

    How can tell the script full color to underline text

    HarveyLiu Level 1

      I write a script for del  square brackets and then make some markups, then i want the underline has a specify color

       

      before del square brackets like this:

       

      ASSETS

      Non-current assets

      Investments in subsidiaries                    45 [448,520]              [448,520]

      Current assets

      Amounts due from subsidiaries              17 [29,577,718]   [24,414,028]

      Other receivables and prepayments      17 [7,095]                     [3,072]

      Restricted cash                                       18 [2,786,304]      [1,033,136]

      Cash and cash equivalents                    19 [173,502]            [505,184]

                                                                          [32,544,619]   [25,955,420]

      Total assets                                               [32,993,139]     [26,403,940]

       

      I want get the result like this:

       

      ASSETS

      Non-current assets

      Investments in subsidiaries                  45          448,520         448,520

      Current assets

      Amounts due from subsidiaries            17     29,577,718     24,414,028

      Other receivables and prepayments     17             7,095              3,072

      Restricted cash                                     18     2,786,304        1,033,136

      Cash and cash equivalents                   19        173,502           505,184

       

       

                                                                            32,544,619     25,955,420

       

       

      Total assets                                                  32,993,139      26,403,940

       

       

      but not work, two lines have error, can someone help me to fix it?

       

      app.findGrepPreferences = app.changeGrepPreferences = null;
      app.findGrepPreferences.findWhat = "\\[(.)";
      app.changeGrepPreferences.changeTo = "$1";
      app.changeGrepPreferences.underline = true;
      app.changeGrepPreferences.underlineColor = swatches.item "underline"; // <----- the script has an error in this line
      app.selection[0].changeGrep();
      app.findGrepPreferences = app.changeGrepPreferences = null;

       

      app.findGrepPreferences = app.changeGrepPreferences = null;
      app.findGrepPreferences.findWhat = "(.)\\]";
      app.changeGrepPreferences.changeTo = "$1";
      app.changeGrepPreferences.underline = true;
      app.changeGrepPreferences.underlineColor = swatches.item "underline"; // <----- the script has an error in this line
      app.selection[0].changeGrep();
      app.findGrepPreferences = app.changeGrepPreferences = null;