Script not functioning in InDesign 2025
I have a script I've been using since 2010 that will not work with InDesign 2025. It saves the InDesign file to single page PDFs with the file name being the page number. I have no knowledge of scripts (only how to use them). Can anyone help diagnose what needs to change?
tell application "Adobe InDesign 2025"
set doc_name to active document
set doc_pages to every page of doc_name
set file_name to text returned of (display dialog "Please enter a File Name:" default answer "" buttons {"Cancel", "Ok"} default button 2 with icon 1)
set pdf_style to name of every PDF export preset
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 "Please select your destination folder...") 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 3
display dialog "Your PDFs were successfully exported" buttons {"Done"} default button 1
end tell
