title: How to get number of CC libraries in InDesign?
body: <p>I am a beginner with InDesign scripting, trying to access libraries, but they appear to be not there.</p>
  
  <p>My code so far:</p>
  
  <pre class="lang-js prettyprint-override"><code>app.doScript(Main, undefined, undefined, UndoModes.ENTIRE_SCRIPT, "Run Script");
  
  function Main() {
      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
  
      var mydoc = app.documents.item(0);
      var lib_length = app.libraries.length; // not working
      var mypages = mydoc.pages.length; //works
  
      alert(lib_length, "\n");
  
      return 0;
  }
  </code></pre>
  
  <p>I have 3 libraries, My Libraries, library1 and library2 with images in them. My code returns 0 libraries.</p>
  
  <p>PS. Searching many files one by one in CC libraries with thousands of items is painful. I ultimately want to remake ImageCatalogFromList.jsx so it actually accepts a list(xlsx, csv) and place from CC libraries instead. It seems it is impossible to have scripts access and filter CC libraries. I may try menuActions but it also seems to have access only to the context menu.</p>