Re: Scripting QuarkXPress 5 in Classic mode
Re: Scripting QuarkXPress 5 in Classic mode
- Subject: Re: Scripting QuarkXPress 5 in Classic mode
- From: Hans Haesler <email@hidden>
- Date: Sat, 10 Jan 2004 22:56:02 +0100
On Fri, 9 Jan 2004, Pat Cannon wrote:
>
I've got a script which works fine in OS 9. Here's a piece of it --
>
pardon the high ASCII:
>
>
tell application "QuarkXPress 5.0"
>
set myDocument to document 1
>
tell myDocument
>
set pageHt to page height
>
set pageHtreal to pageHt as real
>
display dialog pageHtreal
>
end tell
>
end tell
>
>
This gives me, like, "17.0" which is what I want, when I step through
>
the script in Scripter under Classic. Or "17" (not "17.0",
>
interestingly) via the dialog box.
>
>
However when I attempt to step through the script in Smile under
>
Jaguar (with Quark 5 running in Classic), or run it from the Script
>
Editor, I get: "Can't make +data FXVM04C80000; into a real."
>
>
What's up? Should I tell my coworkers to just wait for Quark 6?
Hello Pat,
yes, you should. It doesn't make sense to run QXP 4 or 5
in Classic. They're not developed for Mac OS X.
However, if you haven't the choice, then you must adapt your
scripts because the automatic coercion doesn't work anymore.
The <<data FXVM04C80000>> is "raw code" where 'FX' stands for
'fixed' and 'VM' for 'vertical measurement'. The rest is the height
of the page in points in ... hexadecimal notation. If you feed
'04C8' to a converter you'll get '1224'. And 1224 pt are 17 inches.
But all it takes is to insert an explicit coercion in your
script. Replace...
---
set pageHt to page height
set pageHtreal to pageHt as real
---
... by...
---
set pageHtreal to coerce (get page height) to real
---
... then you'll get '17.0'
---
Hans Haesler <email@hidden>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.