This script doesn't create images of all pages, it extracts the one(s) that are saved earlierby InDesign. And that depends on the version (in CS4 and earlier there was only an image of the first page per file) and on the user settings (it's possible to disable thumbnails entirely, or -- on CS5 and newer -- only to have it generated the first n pages).
Given that, and your observation the script ought to be able to extract all available images, I would guess there is only one image in the files you tested.
I agree with all that Jongware said.
By the way, this is my snippet,
and you probably want to read it and it will be clear:
Also, there is /*missing*/ placeholder which have to be replaced with
If you want to have more than one-two previews, you have to enable them in InDesign preferences.
Hope that helps.
As it happens, I also made an external executable for Windows a while ago. All you need to do is drop an ID file on its icon (or use the command line), and it will extract as much thumbnails as possible from it.
See http://forums.adobe.com/thread/793459 for the Full Why and How.
So, what's the problem, the script, or the version of InDesign? Following are the few information about the document that I tested:
1. It's InDesign CS3 document
2. It has two pages and in both the pages there is at least one image
I think the problem is getting to know what you intend to do!
The original script you posted doesn't extract "images", as you assumed; it only extracts the page thumbnails InDesign creates for preview purposes (as I assumed you meant to do). This has nothing to do with, uh, the usual images one can place onto a page -- and it seems you want to somehow extract these instead.
Now that's cleared up (I think ), can you explain why you think you need to 'extract' these images? Are they placed bitmaps? Linked files? Embedded?
Ah! I'm sorry. Probably I couldn't explain you my problem. So let me give you some background.
We used to generate the preview of all the pages in an InDesign document using the export functionality. But we found that, it's a slow process especially when the document uses images that are huge in size (can even be 2 or more GB). So we decided that since InDesign already has the preview (we can see this even the image link is broken), why shouldn't we use this?
But while doing this, I realized that I can't get the preview of other pages except the first page.
So, can we say the script can't generate preview images of all the pages (I'm not talking about the individual images placed in a page), or the script is OK but it can do that only for CS5?
Okay, that's clear.
The script above should be okay but it only can extract previews that are saved with the file. CS5 and newer are the only versions that can save previews of all pages, but it's up to the preferences of the last one to save it.
All other versions may have a preview, and then it's of the first page only, but (again) only if this was set in the preferences when the file was last saved.
All together, I think it's best to go with your slow-but-sure method ...
Thank you very much. Now I got it