0 Replies Latest reply on Jul 2, 2011 12:10 PM by kapooostin

    Export multiple objects as a snippet with javascript and Snippet/s classes

    kapooostin

      Is it possible?

      I spent a whole day to find a way to export a few objects as a snippet without grouping. The biggest step in this direction was made when I created a snippet with

       

      var new_snippet = new Snippet ( my_page_items ); // quite experimental

      current_spread.pageItems[ current_spread.pageItems.length ] = new_snippet;

      current_spread.pageItems.lastItem().exportFile(<...>);

       

      I was nearly there—when placing, the resulting snippet had even correct preview, but ony the first of exported objects was placed actually.

       

      IDMS file is twice less in size compared to a snippet made with manual export and has only this first object in section where spread is described.

      The manually exported and script-generated (through grouping before export) are identical except the aditional group wrapping contents of the snippet. I can delete this group in xml, but some snippets should be a single group, so it is not a way. And automating this would be another headache.

       

      Indesign has Snippets and Snippet classes, but I did not found any traces of practical use of these. Maybe they could help. Any ideas?