Replacing text in Quark 6.5 OSX 10.5

Does anybody know if its possible /how to replace text in Quark6.5 with Applescript?

tell application "QuarkXpress"
  tell document 1
    set (every text of every story where it is "Variable A") to "Value A"
  end tell
end tell

doesn’t seem to function anymore? What am i doing wrong?
Needs this to automate construction of documents?

Thanks in advance.


Model: PowerMac G5 dual
AppleScript: 2.0.1
Browser: Firefox 3.6.23
Operating System: Mac OS X (10.5)

This following code works for me but there need to be at least one match otherwise it throws an error.

tell application "QuarkXPress"
	tell document 1
		set text of every story where it is "variable A" to "bastiaan"
	end tell
end tell

Thanks Bastiaan,

But that’s basically the same solution and it still gives an error.

Which version of Xpress ans Apllescript are you using?


Because I’ve tested it on my other Mac, G4, Quark 6.5 OSX 10.3.9 and then it works

QXPScripting addition in /Library/Scripting additions installed. Mac OS X 10.5.8 and Mac OS X 10.6.8 and QuarkXpress 6.1 cracked version (I own legal licenses but because of activation errors I chose to take the easy way). It runs on both 64-bit machines with i7 processors. (my quark xpress is also a passport version, I don’t know if that makes a difference).

Hmm, only difference overhere :

G4, OSX 10.3.9, Applescript 1.9.3, Quark 6.5 with Script.xtn v6.5.0 – works fine

G5, OSX 10.5.8, Applescript 2.2.1, Quark 6.5.2 with Script.xtn v6.5.2 – gives error

Downgrading Quark perhaps could resolve this, but I’d rather wouldn’t, for the same reason: activation errors !!
Once it’s working, don’t change a thing !!