Hi,
I put the following in a function that is called from inside a loop
tell application "QuarkXPress Passport"
activate
try
set xposition to (init_width + ((coupon_width) * (column1 - 1)))
set xend to (xposition + coupon_width)
set yend to (yposition) + (coupon_height * heightfactor)
tell page 1 of document 1
make picture box at beginning with properties ¬
{bounds:{yposition, xposition, yend, xend}, color:"None"}
tell picture box 1
set image 1 to alias (fileName)
end tell
end tell
end try
end tell
i know the bounds of the picture box and after the picture is inserted, I know the dimensions of the picture. If I do
tell picture box 1
set image 1 to alias (fileName)
set offset of image 1 to {30, 30}
end tell
it works
but if I do
tell picture box 1
set image 1 to alias (fileName)
set offsetx to (((width_of_box)-(width_of_picture))/2)
set offsety to (((height_of_box)-(height_of_picture))/2)
set offset of image 1 to {offsetx, offsety}
end tell
It doesn't work.
Thanks.