Quark 6 coercion bugs in Panther

The coercion bugs scripting Quark from OSX to Classic, which were fixed in Quark 6/Jaguar, are now back with Quark 6/Panther. As before, the workaround is to explicitly use Quark’s own “coerce” command.

tell application "QuarkXPress"
    tell front document
        set boxBounds to bounds of current box as list
        -->>{«data FXVM00F067C5», «data FXHM00480000», «data FXVM0190A01A», «data FXHM00EFEDC8»}
        set boxTop to top of bounds of current box
        -->>«data FXVM00F067C5»
        set boxTop to top of bounds as real
        set boxTop to top of bounds as point units
        --examples of what works
        set boxTop to coerce boxTop to real
        set boxTop to coerce boxTop to string
        -->>"240.405 pt"
    end tell
end tell

Quark is aware of the problem, which has broken some of the bundled scripts.

Ray Robertson


I’ve been running into the same sort of thing—apple events instead of numbers I can use—in Classic on OS 10.2.8 with Quark 5. Have you heard about this problem? (I’ve also got Quark 6 installed but Quark hasn’t gotten around to sending me a new authorization code, so I can’t use it yet.)




Yes, I’ve not only heard of it, but lived through it.

It happens when scripting Quark 4 or Quark 5 from any version of OSX. One way to avoid it is to launch your script editor itself in Classic and save it as a classic script. The other way is to use the coerce command as I described.

Forgive me if you already know what I’m explaining below, but it is a very common issue when scripting Quark…

For bounds and other measurements (like scale, ruler measurements) Quark has never returned numbers or text or lists. The items only look like that, but are in fact special classes within Quark itself. For instance, “bounds of current box” looks like it returns a list, but it is in fact a “measurements rectangle” class specific to Quark. Top of bounds returns a “vertical measurements” class.

To manipulate these items for certain uses, it is necessary to coerce them to other classes. The difference with the problem described in OSX is that they look like gobblygook, which in a way is a bit more honest than looking like a list when its not. But this problem is compounded by the fact that you can’t use the standard AppleScript “as” function (in many cases) to coerce the items to another class. For this problem, you must use Quark’s own coerce event.

Ray Robertson


I didn’t know about the special Quark measurement classes. No wonder I’ve been turning myself inside out over this…

Thank you very much for the workarounds & clarification of the above.


Pssst! Put back the Quark scripting addition that got lost in the Panther upgrade…

[quote=“Shane Stanley”]

Well, well, well. So much for checking with Quark first to confirm this…I should have checked with Shane first. Australia wins out over America and India yet again.

He’s right. Both Quark and Adobe put scripting additions in Library/ScriptingAdditions, which Panther fails to restore in the install. So now I’m just going to groan and complain for a bit…

  • I would expect the Panther installation to handle this. This is core technology, and even though the folder is created by third-party apps, its not like these are minor programs.

  • I would think that somebody at Quark or Adobe with a beta of Panther would have noticed this.

  • I would think its unreal for Quark to take down their support forums when releasing v6.

And on and on–just covering up my oversight.

Thanks, Shane.

Ray Robertson

Ethan or Shane,

Out of curiosity, could you let me know if the Quark 4/5 coercion problems via Classic disappear once the Quark 6 scripting addition is in the right location?

I’ve sworn not to launch Classic under Panther.

Ray Robertson

No, it’s still there under Classic. I can’t see how the scripting addition could get involved with older versions, but I admire your optimism :wink: