Copy link to clipboard
Copied
Hi,
I have a leaflet design that I need to export from InDesign CS5.5 as a PDF multiple times, replacing the job title header on the front of the leaflet for each file.
In my document, I have created a text box for the job title with the word 'placeholder' in it. I created a small test CSV file with the header 'JobTitle' and 4 job titles on the following lines, then closed the CSV. In InDesign, I opened the data merge window, selected my data source, and could see my CSV header 'JobTitle' appearing in the data merge window.
Then, I selected my text box and clicked on 'JobTitle' in the data merge window. Instead of the word 'placeholder' being replaced by '<<JobTitle>>', I see 'placeholder<<JobTitle>>' in my text box. I'm pretty sure that shouldn't happen.
Ignoring that for now, I tried to run a script to export the 4 job title documents as PDFs using a JSX script and gotth error:
JavaScript Error:
Error Number: 55 Error String: Object does not support the property or method 'dataSource'.
Engine: main File: C:\Program Files (x86)\Adobe\Adobe InDesign CS5.5\Scripts\Scripts Panel\JobTitleExport.jsx Line: 5 Source: var dataSource = doc.dataMergeProperties.dataSource;
I also created a brand new document in InDesign with only a text box to further test this and encountered the exact same error. I also attempted to create a plain text file for the data instead of a CSV, but encountered the same error.
I consulted ChatGPT as well, and it confirmed the following:
ChatGPT also mentioned that the placeholder text should be replaced and not appended to the header text in <<>>.
I've been working on this all day and have run out of ideas. Has anybody else encountered these problems?
Many thanks,
Mr. M
Copy link to clipboard
Copied
Because
Error Number: 55 Error String: Object does not support the property or method 'dataSource'.
as showed in
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#DataMerge.html#d1e417238
Never consider ChatGPT as "smart" in regard to InDesign Scripting and keep looking at the InDesign Document Object Model instead.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now