Okay, Keith, I'll make a trade with you - I will tell you how we do it, and you tell me what you are trying to do with this information.
The filename comes from the unique object identifier (we call it a UID) of the object being rasterized. Since each object has a unique UID we are guaranteed that we will not have a filename conflict.
I would caution you to not depend on this, though this remains true even in the upcoming update, because it has been suggested that naming things based on their source page number (plus the UID) might be more helpful to developers who are trying to make sense of what went where. Whether that will actually occur going forward I have no control over at this point, sadly.
Is the UID the same as the object ID that is exposed to scripting? E.g.,
if I run this in the ESTK
(given some object being selected in the UI), is that the same number as
Thank you Douglas. This is really helpful.
Here is what I need this for: I've got a large scripting project where a health care client has 2500+ ID files that are very regular in their layout, structure, use of styles, etc. They need to get the content from these documents, along with the simple layout (h1, h2, h3, body, etc) into various CMS. Some of the CMS ingest HTML, some XML, etc. I've written a series of scripts that help a user quickly check/cleanup/"normalize" a document, and then export to html/xml per the specifications of the CMS.
For various reasons, I'm using InDesign's HTML export engine as the starting point, so it creates a "web-resources" folder and dumps the images in there. We need to dump the images that are generated from each document's export into a common images folder. We can be guaranteed that the placed image filenames are unique. But it looks like the auto-generated filenames from the UID will not likely always be unique, so I'll probably add a timecode or something to the filename to ensure that it is unique.
This is a very unique and challenging project. I'm having fun with it.
@Keith – ah, interesting…
You wrote: "But it looks like the auto-generated filenames from the UID will not likely always be unique…".
Could you elaborate on this?
UIDs derived from pageItem.id should be unique regarding the scope of a single document at a given point in time. At least that's my experience with ExtendScript.
@Uwe, Sorry, what I meant is that the auto-generated filenames from the UID will not be unique across a large group of documents. We'll be dumping all the images from 3000 documents into a single folder, so the names must be unique. I've pre-pended the unique filename to each image file name, so this should ensure that they are unique.