InDesign CS2 Export PDF and EPS need help

Helloo all,
I am attempting to set up a script that will export to PDF from InDesign on one command and EPS from another, but I don’t know how to continue.
I have looked up examples and trialed this syntax (which is correct according to the dictionary)

tell application "Adobe InDesign CS2"
open work_file
tell document 1
--if you get an error, try "eBook" without the brackets
export format PDF type to (the_container & the_name & ".pdf") using PDF export style "eBook" without showing options
close saving no
end tell
end tell

But it keeps erroring on the word “Style” saying “expected end of line but found property”
Any help would be greatly appriciated.
Chuckles :smiley:

Model: G5
Browser: Firefox 1.0
Operating System: Mac OS X (10.4)

It has been a while since I have done exports in InDesign, but as I recall you need to set your PDF export options before exporting. I will check to see if I have any examples and get back shortly.

Afet a bit of playing around with it, though I’m using CS some syntax may have changes slightly, here is what I came up with:

tell application "InDesign CS"
	--open work_file
	set the_container to (file path of document 1 as string)
	--if you get an error, try "eBook" without the brackets
	export document 1 format PDF type to (the_container & "Test") using PDF export preset "[eBook]" without showing options
end tell

I think that one of the biggest problems may have only been the name of the export style (preset) not having the brackets included. Hope that this helps you figure it out for CS2, I have it at work but not at home to test it on.

Hi,
Thanks for the idea but still no go. It compiles but doesn’t run. I fiddled about with the code some but didn’t yeild any results.

when I ran it it returned the error:
Adobe InDesign CS2 got an error: Invalid value for parameter ‘using’ of event ‘export’. Expected PDF export preset, but received nothing.
I rearanged the code a bit to try to get it to work but same error.
(as a side note, anybody know how to open up automator workflows as applescript?)
Chuckles66 :smiley:

These are the settings I use to make a pdf from InDesign. There is a document available on the adobe studio site, which explains how to export things like pdf’s. I hope you find this useful.

tell application "InDesign CS"
			tell document preferences of active document
				set myx1Offset to document bleed inside or left offset
				set myy1Offset to document bleed top offset
				set myx2Offset to document bleed outside or right offset
				set myy2Offset to document bleed bottom offset
				set bleedoffset to 5.0
				
			end tell
			tell PDF export preferences
				set page range to all pages
				set acrobat compatibility to acrobat 6
				set export guides and grids to false
				set export layers to false
				set export reader spreads to false
				set generate thumbnails to false
				try
					set ignore spread overrides to false
				end try
				set include bookmarks to false
				set include hyperlinks to false
				try
					set include ICC profiles to false
				end try
				set include slug with PDF to false
				set include structure to false
				set interactive elements to false
				set subset fonts below to 99
				set color bitmap compression to JPEG
				set color bitmap quality to maximum
				--set color bitmap quality to eight bit
				set color bitmap sampling to none
				set grayscale bitmap compression to JPEG
				set grayscale bitmap quality to maximum
				set grayscale bitmap sampling to none
				set monochrome bitmap compression to none
				set monochrome bitmap sampling to none
				set compression type to Compress None
				set compress text and line art to false
				set content to embed to Embed All
				set crop images to frames to true
				set optimize PDF to true
				set bleed bottom to myy2Offset
				set bleed top to myy1Offset
				set bleed inside to myx1Offset
				set bleed outside to myx2Offset
				set page marks offset to bleedoffset
				set bleed marks to false
				set color bars to false
				set crop marks to true
				set registration marks to true
				set omit bitmaps to false
				set omit EPS to false
				set omit PDF to false
				set page information marks to true
				set PDF color space to unchanged color space
				set PDF mark type to default
				set use document bleed with PDF to true
				set view PDF to false
			end tell
			tell document 1
				export format PDF type to [i]define path here with filename[/i] without showing options
			end tell

The following worked fine for me just a minute ago:

tell application "Adobe InDesign CS2"
	set the_container to (file path of document 1 as string)
	export document 1 format PDF type to (the_container & "Test") using PDF export preset "[Smallest File Size]" without showing options
end tell

You might want to verify the name of the preset that you are using with the following code:

tell application "Adobe InDesign CS2"
	set x to name of every PDF export preset
end tell

THANKYOU!!! Thankyou both so much for your extremely helpful replies. I am now able to export PDFs from InDesign. I have a rather complex (for me at least) script designed to use MultiAd Creator (and now InDesign) to send proofs of advertisements to clients. Anyway I greatly appriciate all the help provided by everybody who has contributed to my various posts. This site has become my goto for applescript, and I will post a few of my other scripts to show my appriciation.

Anyway, I digress, I am now asking the second part of my question, which is, how do you export EPS from InDesign?

I also use a multi purpose EPS exporting script for final artwork. Once I have finished it I will post it and the others on here either on a new post or in another section.

Thanks again
Chuckles :smiley:

I have just checked the dictionary of InDesign CS, and it seems that EPS files can be exported the same way as I defined in my post, it may be worth checking the InDeisgn dictionary of Script Editor to set up the export for your eps files.

I believe that CS is right, you set your EPS export preferences up the way you want them and export the EPS. As far as I know there are no EPS export presets so you can’t do it that way though.

I had a go at setting up the prefs but i keep getting the error “InDesign cannnot continue export”
This is what i was working with.

tell application "Adobe InDesign CS2"
	tell EPS export preferences
		set EPS color to unchanged color space
		set EPS spreads to true
		set font embedding to subset
		set image data to all image data
		set omit bitmaps to false
		set omit EPS to false
		set omit PDF to false
		set OPI image replacement to false
		set page range to all pages
		set PostScript level to level 2
		set preview to TIFF preview
	end tell
	export format EPS type to ((path to desktop) as string) without showing options
end tell

Any help would be appriciated.
Chuckles :smiley:

I will look at it a little later today when I have access to CS2. I doubt that there are any differences but just in case.

You were missing a few important things. First you need to tell InDesign which document that you are addressing, and second what the file name is that your are saving to. The following works for me:

tell application "Adobe InDesign CS2"
	tell EPS export preferences
		set EPS color to unchanged color space
		set EPS spreads to true
		set font embedding to subset
		set image data to all image data
		set omit bitmaps to false
		set omit EPS to false
		set omit PDF to false
		set OPI image replacement to false
		set page range to all pages
		set PostScript level to level 2
		set preview to TIFF preview
	end tell
	export document 1 format EPS type to (((path to desktop) as string) & "File_Name_Goes_Here.eps") without showing options
end tell

Thanks for your reply. This is what I ended up with. Works fine. Kudos to both of you. Much appriciated.

set docName to "test"
set x to (choose folder) as string
set x to x & docName as string
tell application "Adobe InDesign CS2"
	tell EPS export preferences
		set applied flattener preset to flattener preset id 105
		set bleed bottom to 0
		set bleed inside to 0
		set bleed outside to 0
		set bleed top to 0
		set data format to ASCII
		set EPS color to unchanged color space
		set EPS spreads to true
		set font embedding to complete
		set image data to all image data
		set omit bitmaps to false
		set omit EPS to false
		set omit PDF to false
		set OPI image replacement to false
		set page range to all pages
		set PostScript level to level 3
		set preview to TIFF preview
	end tell
	tell front document
		export format EPS type to x without showing options
	end tell
end tell

Thought I should start sharing my results.
Chuckles :smiley: