1 Reply Latest reply on May 23, 2014 8:21 AM by tlumbis

    Prompt before running script action?

    tlumbis

      I have a script which deletes unused character styles.

      When they script is run, I want a dialog to pop up and ask the user if they wish to proceed... If yes, the rest of the script will run. If no, the script will stop.

      I can't seem to find other instances of this. Any help would be appreciated. Thank you.

       

      function removeUnusedCharStyle(myChStyle) {

      app.findTextPreferences = NothingEnum.nothing;

      app.changeTextPreferences = NothingEnum.nothing;

      app.findTextPreferences.appliedCharacterStyle = myChStyle;

      var myFoundStyles = myDoc.findText();

      if (myFoundStyles == 0) {

      myChStyle.remove();

      }

      app.findTextPreferences = NothingEnum.nothing;

      app.changeTextPreferences = NothingEnum.nothing;

      }