I want to set a number of different images as the imageSource for characters in a scrolling field, one per line. When I run my script to do more than one image (with a repeat loop going through my list of file paths) what keeps happening is the latest image in the loop is shown in EVERY imageSource character – replacing the different images set in an earlier loop of the repeat.
Anyone know how I can get this to show different images, one per line?
I can do this if I run each 'set the imageSource' entirely separately, but that's rather missing the point.
Code: Select all
-- 'it' contains a number of file paths, one per line.
repeat with x = 1 to the number of lines of it
-- (1) import an image,
-- (2) scale it,
-- (3) throw away the 'extra' image data, then
-- (4) set the imageData of a char to the imported image
-- (1)
set the filename of image "thumb" to line x of it
-- (2)
set the width of image "thumb" to 720
if the width of image "thumb" > the height of image "thumb" * 6 then
set the height of image "thumb" to 60
else
set the height of image "thumb" to 120
end if
-- (3)
set the imageData of image "thumb" to the imageData of image "thumb"
-- (4)
set the imageSource of char 1 of line x of field "test" to "thumb"
end repeat
k