3 Replies Latest reply on Dec 31, 2012 2:42 PM by Trevorׅ

    Try  Catch problem CS6

    Trevorׅ Adobe Community Professional

      All my try catch scripts don't work on CS6

       

      $.strict = false;
      function myGetScriptPath() {
      try{
      return app.activeScript;
      }
      catch(myError){
      return File(myError.fileName);
      }
      }
      myGetScriptPath()
      

       

      Can anyone tell me the problem?

       

      Thanks

       

      Trevor

        • 1. Re: Try  Catch problem CS6
          Pickory Level 3

          Works here, Mac 10.8.8, CS6, no updates.

           

          P.

          • 2. Re: Try  Catch problem CS6
            Trevorׅ Adobe Community Professional

            Thanks for trying Pickory,

             

            I have Windows 7, with both indesign CS5 and creative cloud CS6 installed

             

            After experimenting I found that the script works fine on the machine with just CS5 on it.

            But on the one that has both doesn't work when called from either version of the ESTK but does from either version of indesign.

             

            When I try run the script from the CS5 ESTK It automatically opens and runs from the CS6 ESTK.

            I am not keen on uninstalling the CS5 ESTK as I don't know how long I'll keep creative cloud.

             

            Bellow is a alternative try catch script because the above one will not invoke an error if run from indesign so it won't call the catch.

             


            cs = app.activeDocument.characterStyles.item("myCharacterStyleName");
            try {alert ("Try $.strict = " +$.strict); myCharacterStyle.name}
            catch (myError) { alert ("Catch $.strict = " +$.strict + "\r" + myError)}
            

             

            I'm quite desperate for an answer.

            • 3. Re: Try  Catch problem CS6
              Trevorׅ Adobe Community Professional

              I got to the cause of the problem

              The do not break on guarded exceptions need to be ticked

               

              Try Catch Test.png