List problem

This might be a stupid question to some of you, but please don`t laught.

I`m trying to retrive some info from Indesign CS, and then loop through it like this:


set missingImages to name of every link whose status is link missing

repeat with i from 1 to (count missingImages)
set i_missingImage to item i of missingImages
end repeat

This works great if there are more than 1 missing image in the list.
But if there is only image, it prints out each character instead of the name…

Is there a fix for this?

It sounds like there’s a bug in InDesign: that ‘name of every link…’ reference should always return a list of strings, but it sounds like it’s returning a string when there’s only one item, which is wrong. I’d recommend checking that line in isolation to confirm the problem’s in ID then file a bug on it.

In the meantime, you’ll need to kludge in some workaround code to keep things right:

if missingImages's class is not list then set missingImages to {missingImages}

HTH

Thaks hhas
That was what i was looking for.

Soloution:


if class of missingImages is not list then 
set missingImages to {missingImages}
end if