0 Replies Latest reply on Apr 2, 2012 2:58 AM by கற்பனை (Imagine)

    InDesign Crash using GetItemFromCollection()

    கற்பனை (Imagine) Level 3

      Hi All,

       

      Its written by Harbs,  using the method in InDesign CS5.5 Windows 7 application crashed suddenly when executing the red highlighted statement.  I would like to know how to fix these issues.

       

      function GetItemFromCollection(label,collection){
          var scriptVersion = app.scriptPreferences.version;
         if( parseFloat(scriptVersion) > 6){app.scriptPreferences.version = 6}
          var items = collection.item(label).getElements();
          app.scriptPreferences.version = scriptVersion;
          if(items.length==0){return null}
          if(items.length==1){return items[0]}
          return items;
      }

       

      Snapshot for references.

       

      Error.jpg

       

      Kindly suggest any solution is possible.

       

       

      Thanks in advance,

      Karpanai.