2 Replies Latest reply on Nov 1, 2012 4:13 AM by martinpet

    Export Objects to JPGs by ObjectStyle

    martinpet

      Hi all,

       

      i'm looking for advice and help in scripting the follwing:

       

      I have an InDesign document with multiple pages and certain elements/groups that i'd like to export to JPGs. Every element or group i'd like to export, has a certain object style applied for identification purposes.

       

      Now i know that it is possible to export selections to JPGs like described in this thread. As i would need to select the items manually in the linked scenario, it isn't an automated process. Basically i need the same thing as the export selection to JPG script wihtout selecting the elements but identifying them by a certain object style instead.

       

      Every help attempt is highly appreciated.

       

      Regards, Martin

        • 1. Re: Export Objects to JPGs by ObjectStyle
          -hans- Level 4

          ollah,

           

           

          var myBestObjectStyle = 'myBestObjectStyle';
          
          var currDocPageItems = app.activeDocument.pageItems.everyItem().getElements();
          
          l = currDocPageItems.length;
          
          while(l--){
              curPageItem = currDocPageItems[l];
              if(curPageItem.appliedObjectStyle.name === myBestObjectStyle){exportToJPG(curPageItem);}
              
              }
          
          function exportToJPG(someFunnyPageItem){
              someFunnyPageItem.select();
          alert('fireYourExport here ...')    ;
              }
          

           

          gives you the page item -> run the export from there ...

           

          Hans-Gerd Claßen

          1 person found this helpful
          • 2. Re: Export Objects to JPGs by ObjectStyle
            martinpet Level 1

            Hallo Hans,

             

            thanks. I got it working. curPageItem.appliedObjectStyle.name  was the thing, that i've been looking for.

             

            regards, Martin