I am looking for a reliable way to get the record count for an indesign data merge. The idea is to set up the merge fields in indesign, then my script will step through each record and create an individual indesign file as well as a pdf and name the files from an appropriate data field in the merge. This is a snippet of what I have:
tell application "Adobe InDesign CS5"
set myoriginal to document 1
tell data merge properties of myoriginal
set myDataMergeProperties to properties
set dmRcount to record range of data merge preferences
set dmRcount to word -1 of dmRcount as real
end tell
end tell
This works great, and I have the script working to do exactly what I want, EXCEPT....
If using the same indesign file and I select a new data source, the record range of data merge preferences does not change and I end up with the wrong record count.
I have no clue how to get around this so any suggestions would be greatly appreciated.
Paul