16 Replies Latest reply on Mar 27, 2015 7:44 AM by Willi Adelberger

    script to export each page change width/height and save as jpg

    hendu

      I have an InDesign file with 1200 pages...

      I need to export all 1200 pages as jpg thumbnails for use outside the document any ideas?

        • 2. Re: script to export each page change width/height and save as jpg
          hendu Level 1

          I use both mac and windows. So any help with either would be tremendously appreciated.

          • 3. Re: script to export each page change width/height and save as jpg
            rob day Adobe Community Professional & MVP

            This AppleScript should work. If you want to change the jpeg output options edit the properties in the set properties of JPEG export preferences to... line. Copy and paste the code into Apple's Script Editor and save to your scripts folder

             

            ----------------------------------------------------

            tell application "Adobe InDesign CC 2014"

               

                --the export settings to use

                set properties of JPEG export preferences to {simulate overprint:true, anti alias:true, use document bleeds:false, jpeg color space:RGB, embed color profile:true, JPEG Quality:maximum, JPEG Rendering style:baseline encoding, Exporting Spread:false, export resolution:72.0}

             

                set myPageNumPref to page numbering of general preferences

                set page numbering of general preferences to absolute

                set NumberOfPage to pages per document of document preferences of active document

                --choose the folder for exported files

                set myFolder to (choose folder with prompt "Please select an Export Destination") as string

               

                -------------------------------export JPEGSs----------------------------------

               

                tell active document

                    repeat with x from 1 to NumberOfPage

                        --set the page number with a leading 0

                        set mynumbertest to x as string

                        set mynumbercnt to count of items in mynumbertest

                        if mynumbercnt is less than 2 then

                            set myPageName to "0" & (name of page x)

                        else

                            set myPageName to (name of page x)

                        end if

                        --save the page as a JPEG

                        set thePath to (myFolder & name & "-" & myPageName & ".jpeg")

                        --Export the JPEG.

                        tell application "Adobe InDesign CC 2014"

                            set JPEG export range of JPEG export preferences to export range

                            set Page String of JPEG export preferences to x as string

                            export document 1 format JPG to thePath

                        end tell

                    end repeat

                end tell

               

                -------------------------------reset----------------------------------

               

                tell application "Adobe InDesign CC 2014"

                    activate

                    set page numbering of general preferences to myPageNumPref

                    display dialog "Pages have been exported."

                end tell

            end tell

            • 4. Re: script to export each page change width/height and save as jpg
              Willi Adelberger Most Valuable Participant

              Why do you need all pages as JPG? What is the purpose, maybe a different file type would be better?

              • 5. Re: script to export each page change width/height and save as jpg
                rob day Adobe Community Professional & MVP

                I just noticed in your subject line you want to change the jpeg's output width and height? My script isn't doing that because ID exports to the page dimensions, but it would be possible to include via Photoshop or Apple's image events.

                • 6. Re: script to export each page change width/height and save as jpg
                  hendu Level 1

                  i need to have jpg thumbnails. much smaller than the actual document.

                  I am looking for advice. Do you have a better suggestion.

                  • 7. Re: script to export each page change width/height and save as jpg
                    hendu Level 1

                    yes i will be exporting them and creating thumbnails. I am looking for a script to do all of this at once so it's not so cumbersome.

                    I can export them all, then open with photoshop and use an action. to do this, but i'm trying to make as efficient as possible.

                    • 8. Re: script to export each page change width/height and save as jpg
                      rob day Adobe Community Professional & MVP

                      You can manipulate the pixel dimensions of the exported jpegs via the export resolution property in my script. So depending on where you are using the thumbnails the output width and height dimensions might not matter.  For example if your document is 8.5x11 it will export 612x792 pixel jpegs if you use export resolution:72.0. If you changed it to export resolution:36.0 you'll get a 306x396 pixel jpeg.

                      • 9. Re: script to export each page change width/height and save as jpg
                        Willi Adelberger Most Valuable Participant

                        When you tell us for what you need these thumbnails, we might give you an alternative.

                         

                        Or do you want only to fill your disk with a lot of small files?

                        • 10. Re: script to export each page change width/height and save as jpg
                          hendu Level 1

                          I'm not looking for sarcasm. I'm looking for a solution.

                          I appreciate your wanting to help, and if you have a solution for extracting jpg thumbnails I will be more than happy to say thank you.

                          • 11. Re: script to export each page change width/height and save as jpg
                            Willi Adelberger Most Valuable Participant

                            It's not sarcasm, but for me, it looks nonsense per se to make hundreds of JPGs.

                            You can export a PDF/X-4 and convert them in one step into any kind of pixel file type. But it makes no sense.

                            Some people need to have thumbnails in a printed document. Huge nonsense to use JPGs as PDF/X-4 would give a much higher quality.

                            So I would recommend you, to answer my questions. I always ask to help people. Some are answering by guessing what someones final idea might be. Your question like "… much smaller than the actual document." indicates that you don't have any basic knowledge what InDesign is nor what JPG is. What do you mean with it? In which dimensions smaller? Metric or pixels? Such questions indicate that you don't have background knowledge and that's why you should really answer the questions.

                            • 12. Re: script to export each page change width/height and save as jpg
                              hendu Level 1

                              Man for someone who likes to help your tone is really condescending. I answer questions on several tech forums and have never told anyone "you don't have any basic knowledge..." of anything. That statement assumes a lot, and usually is very wrong. Usually the user asking the question assumes the professionals answering the questions are more interested in answering that question than getting the blueprint for what ever they are building with it.  For instance this is my question:

                               

                              "Script to export each page, change height/width, and save as jpg

                              I have an InDesign file with 1200 pages...

                              I need to export all 1200 pages as jpg thumbnails for use outside the document any ideas?"

                               

                              So because my assumption was wrong. Answers to your questions: I need the thumbnails to manipulate outside of the original document. My document is 8.5inx11in or 612x792 pixels. I need thumbnails to be 65x84 pixels. I cannot use the pages in the document and just resize them, because there will only be a small subset of thumbnails that show at any given time. I need maximum flexibility to get that I need the document, and thumbnails separated.

                               

                              Again, thank you for your assistance.

                              • 13. Re: script to export each page change width/height and save as jpg
                                rob day Adobe Community Professional & MVP

                                To output 65x84 we would set the JPEG output resolution to 7.647 (65/8.5).

                                 

                                Here's a compiled version of the script that you can copy into your scripts folder:

                                http://www.zenodesign.com/forum/IDpageThumbs.zip

                                • 14. Re: script to export each page change width/height and save as jpg
                                  hendu Level 1

                                  rob day    THANK YOU!

                                  I appreciate your willingness to help. I will use this right away and let you know how it goes.

                                   

                                  thanks again.

                                  • 15. Re: script to export each page change width/height and save as jpg
                                    rob day Adobe Community Professional & MVP

                                    Set your rulers to inches before you run the script—forgot to set them in the script.

                                     

                                    Here's a version that automatically uses inches:

                                     

                                    http://www.zenodesign.com/forum/IDpageThumbsV2.zip

                                    • 16. Re: script to export each page change width/height and save as jpg
                                      Willi Adelberger Most Valuable Participant

                                      Even if you have a solotion. I am not recommending to export JPGs from InDesign as the quality is much worser than doing it in Photoshop. That's why I would recommend to do it from Photoshop.

                                       

                                      And sorry, I have got in the last days from someone many JPGs to build in in print products, previews made from products made from InDesign which I had to use in InDesign again, as it is common believe that thumbnails as JPGs are the best choice to import. But with I would have been happy if I would have got PDF/X-4, it could help me to produce these thumbnails in a much higher quality for print with much less work than with the JPGs.

                                      So I think the correct answer is always related to the purpose what the result is for not to give an easy answer only to the question, as the question is often limited by the how it was done in the last Years.