Hi, I have some problems concerning using a script to replace
images in a QuarkXpress document. I use this script snippet:
tell application “QuarkXpress”
tell document 1
tell picture box x (I repeat through all the picture boxes)
set ImageScale to scale of image1
set ImageAngle to angle of image 1
set ImageOffset to offset of image 1
set image 1 to alias “my:picture:file”
set scale of image 1 to ImageScale
set angle of image 1 to ImageAngle
set offset of image 1 to ImageOffset
end tell
end tell
end tell
Here’s the first problem: if a picture box is not
selected when the image is placed, Quark crashes. I can prevent this by setting
the “selected of every picture box to false” at the beginning of
the repeat loop, and then setting the selected of the one picture box to true before
placing its image. A second problem arises at this point – pictures will
not be placed in grouped picture boxes, and Quark returns no error when it can’t
complete the script command to do so.
I’m working with a couple of limitations – the images
I’m replacing don’t have the same extension as the ones originally
placed, so Quark doesn’t recognize them as being modified and can’t
update them by itself. Also, the documents belong to a client and can’t
be modified by ungrouping the picture boxes.
I’m using QuarkXpress 6.5 on a G5 running OS 10.4.8.
Any thoughts?
Garry Simon