Re: Why does system lock up when scripting Quark?
Re: Why does system lock up when scripting Quark?
- Subject: Re: Why does system lock up when scripting Quark?
- From: Hans Haesler <email@hidden>
- Date: Sun, 8 Apr 2001 17:06:49 +0200
On Sun, 8 Apr 2001, Gsimon59 wrote:
>
(...) Does anyone have any idea as to why I'm locking up?
G,
your script runs fine, here. Of course...
However, you're doing unnecessary things to the image of picture box 2:
>
tell picture box 2
>
try
>
set image 1 to alias PictureFile2
>
set SecondOffset to offset of image 1
>
if SecondOffset is not {"0\"", "0\""} as measurements point then
>
set offset of image 1 to {"0\"", "0\""} as measurements point
>
end if
After importing the image (with line 3) the offset _is_ {"0\"", "0\""}.
No need for getting and testing it. Could be that, sometimes, the image
is not ready when you ask (unnecessarily) for the offset. BTW, there is
no reason for using 'measurements point' when you _set_ the offset.
So, please, try if the following snippet helps.
Important: you should update your QuarkXPress to version 4.11, maybe
this would help, too. Fact is: bugs are fixed, features are added.
---
set PictureFile1 to "Macintosh HD:test_files:image1.eps"
set PictureFile2 to "Macintosh HD:test_files:image2.eps"
tell application "QuarkXPress 4.11"
activate
tell page 1 of document 1
tell picture box 1
set FirstOffset to offset of image 1
set FirstAngle to angle of image 1
try
set image 1 to alias PictureFile1
on error
set image 1 to choose file with prompt "Choose picture 1:" of type {"EPSF"}
end try
if FirstOffset is {"0\"", "0\""} as measurements point then
set bounds of image 1 to centered
else
set offset of image 1 to FirstOffset
set angle of image 1 to FirstAngle
end if
end tell
tell picture box 2
try
set image 1 to alias PictureFile2
on error
set image 1 to choose file with prompt "Choose picture 2:" of type {"EPSF"}
end try
end tell
end tell
end tell
---
Regards,
Hans
---
Hans Haesler | email@hidden