I am trying to export each page of an indesign file to jpeg. I have accomplished this by running a loop using the pageCount for the document and setting the “export range” for the JPEGExportPreferences to that page I am trying to export.
Code:
set y to 1
repeat with x from 1 to PageCount
set this_page to (name of page x of myDocument) as integer
if this_page < 10 then set page_string to "000" & (name of page x of myDocument)
if this_page > 9 and this_page < 100 then set page_string to "00" & (name of page x of myDocument)
if this_page > 99 and this_page < 1000 then set page_string to "0" & (name of page x of myDocument)
if this_page > 999 then set page_string to (name of page x of myDocument)
set filepath to (myFolder & page_string & ".jpg")
--display dialog filepath
set j to name of page x of myDocument
set Page String of myJPEG_Prefs to (y as string)
export document 1 format JPG to filepath without showing options
--export for web page x of document 1 to filepath [i]//Does not work. Probably need to be just getting the object, but I really need to flatten all objects in the page and export the page for web.[/i]
set y to (y + 1)
end repeat
Problem? I get a huge file because it is not compressing the tiff that is pulled into the page as a graphic in an object.
I need these pages exported using the “export for web” method. I cannot figure out the syntax for this. Any help would be greatly appreciated.