Re: Conversion to numerics with Quark
Re: Conversion to numerics with Quark
- Subject: Re: Conversion to numerics with Quark
- From: Ken Tozier <email@hidden>
- Date: Fri, 2 Dec 2005 22:56:17 -0500
On Nov 30, 2005, at 11:09 AM, ErikXmedia2 wrote:
I have for some time done scripting with Quark, and have never had
any problem getting dimensions and positions of boxes as numeric data.
Some time ago I was visiting a customer, and suddenly the scripts
did not work, because I could not get the bounds of a box as
numeric data.
The scripts continued to work on my computer and at other customer
sites. Las week I went back to the problem customer. Same problem,
but this time the problem got into my computer also. Now my scripts
do not work any more on my own computer.
I have the impression that this is connected to the Apple System
and its way of translating the scripts. If it has had a script
translated once it will continue to translate it this way.
I had the same problem earlier on system 9 where applescript would
“remember” the translation from one version of Quark. And you had
to restart you system in order to switch between versions of
QuarkXpress.
The problem now is under OS X, and I do not know how to clear the
“invisible” memory of AppleScript.
I am using QuarkXpress 6.5 on OS 10.3.5 (customer is on 10.3.9 or
10.4) the script I want to execute is:
tell application "QuarkXPress Passport™"
tell document 1
copy (coerce (bounds of generic box 1 as rectangle)
to list) to {jtop, jleft, jbottom, jright}
set jrright to jright as real
set jrtop to jtop as real
set jrleft to jleft as real
end tell
end tell
I'm taking my first forays into scripting Quark 6.5 and these two
utility routines work fine for me on OS 10.4.3. Don't know about
earlier versions of OS X or Quark though, you'd have to test them out.
on GetCurrentBoxBounds()
tell application "QuarkXPress"
tell current box
set temp to bounds as points rectangle as fixed rectangle
end tell
return {cbTop:top of temp as real, cbLeft:left of temp as real,
cbBottom:bottom of temp as real, cbRight:right of temp as real}
end tell
end GetCurrentBoxBounds
on SetCurrentBoxBounds(inNewBounds)
tell application "QuarkXPress"
tell current box
set bounds to inNewBounds as points rectangle
end tell
end tell
end SetCurrentBoxBounds
set x to GetCurrentBoxBounds()
SetCurrentBoxBounds({cbTop of x, cbLeft of x, (cbBottom of x) - 50,
(cbRight of x) - 50})
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden