Single Page PDF (Indesign)

Try to get a script that will do single page PDF out of indesign CS3. Here what I got so far. Any help would be great thanks


tell application "Adobe InDesign CS3"
	
	set doc_name to active document
	set file_name to name of doc_name as text
	set doc_pages to pages of doc_name
	
	set pdf_style to name of PDF export presets
	set export_style to (choose from list pdf_style with prompt "Select PDF Export Preset") as string
	set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
	
	repeat with anItem in doc_pages
		set page_number to name of anItem as string
		
		count characters of page_number
		if length of page_number is 1 then
			set new_number to text -3 thru -1 of ("00" & page_number)
		end if
		if length of page_number is 2 then
			set new_number to text -3 thru -1 of ("0" & page_number)
		end if
		if length of page_number is 3 then
			set new_number to page_number
		end if
		if length of page_number is 4 then
			set new_number to page_number
		end if
		
		set PDF_name to folder_path & file_name & "_" & new_number & ".pdf"
		set page range of PDF export preferences to page_number
		tell doc_name
			export format PDF type to PDF_name using export_style without showing options
		end tell
		
	end repeat
	
	beep
	display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell

Hi,

I have a déjà vu. Didn’t you ask already twice a very similar question?
try this:


tell application "Adobe InDesign CS3"
	activate
	tell (active document) to set {file_name, doc_pages, page_numbers} to {name, pages, name of pages}
	set pdf_style to name of PDF export presets
	set export_style to (choose from list pdf_style with prompt "Select PDF Export Preset") as string
	if export_style is "false" then return
	set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
	set pagesToPrint to (choose from list page_numbers with prompt "choose page(s) to print" with multiple selections allowed)
	if pagesToPrint is false then return
	repeat with anItem in pagesToPrint
		if length of anItem is 4 then
			set new_number to contents of anItem
		else
			set new_number to text -3 thru -1 of ("00" & anItem)
		end if
		set PDF_name to folder_path & file_name & "_" & new_number & ".pdf"
		set page range of PDF export preferences to anItem
		tell active document to export format PDF type to PDF_name using export_style without showing options
	end repeat
	beep
	display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell

Hi Fish

Looks like stefan beat me to it!!
heres my feeble attempt anyhow!!

tell application "Adobe InDesign CS3"
	set dN to name of document 1
	set x to (path to desktop folder) & dN & ".pdf" as string
	tell PDF export preferences
		set acrobat compatibility to acrobat 6
		set crop marks to true
		set export layers to true
		set optimize PDF to true
		set color bars to true
		set page information marks to true
	end tell
	tell front document
		export format PDF type to x without showing options
	end tell
	tell application "Finder"
		set x to x as alias
		set theText to name of x
		set OldDelims to AppleScript's text item delimiters
		set AppleScript's text item delimiters to ".indd"
		set newText to text items of theText
		set AppleScript's text item delimiters to ""
		set newText to newText as text
		set AppleScript's text item delimiters to OldDelims
		set name of x to newText
	end tell
end tell