4 Replies Latest reply on Mar 6, 2014 1:21 AM by Peter Kahrel

    Setting findTextPreferences is not working

    Jon Indicator

      Hi!

       

      I have an old script (written in javascript) we developed for InDesign CS3.

      It worked in that version of InDesign.

       

      Now we are moving to InDesign CC, so I started to adapt that script.

       

      It seems script is stopping in the following line of code:

       

      app.findTextPreferences = NothingEnum.NOTHING;

       

      Does anybody know what is going on?

       

      I am printing to console to be sure it is this line. Here it is the code:

      $.writeln('remove: A');

              $.writeln(typeof app.findTextPreferences + ' - ' + typeof NothingEnum.NOTHING);

              app.findTextPreferences = NothingEnum.NOTHING;

              $.writeln(typeof app.findTextPreferences + ' - ' + typeof NothingEnum.NOTHING);

              $.writeln('remove: B');

              app.changeTextPreferences = NothingEnum.NOTHING;

              $.writeln('remove: C');

              app.findTextPreferences.appliedCharacterStyle = THEMATIZATION_STYLE_NAME;

              $.writeln('remove: D');

              app.changeTextPreferences.changeTo = '';

              $.writeln('remove: E');

              myParagraph.changeText();

              $.writeln('remove: F');

              app.findTextPreferences = NothingEnum.NOTHING;

              $.writeln('remove: G');

              app.changeTextPreferences = NothingEnum.NOTHING;

              $.writeln('remove: H');

       

      The output in console is:

      remove: A

      object - object

       

      I have to admit it is very discouraging to work with Extend Script.

      I expected this version to improve some issues and my feeling is that it did not happen.

      And what is worse, some things have stopped working.

       

      Thanks for your help.

       

      Kind regards!