tell application "QuarkXPress"
tell document 1
-------------Counts "E codes" and compares to "#"
counts for all correct test ---
try
set refList to object reference of every text of
every story whose contents is OldECode as text
you can't coerse a reference to text with "as text"!
But the reference points to the text and you can ask for the text's
properties.
It's the contents of the text you want to have, isn't it?
Try this:
tell application "QuarkXPress"
tell document 1
tell text box 1
-- ask for a list of references
set textRefList to (object reference of every text whose contents
is "XXX")
-- ask for a list of content
set textContentList to (contents of every text whose contents is
"XXX")
end tell
--loop thru a list of references and operate
repeat with aRefToList in textRefList
--return aRefToList
set aRef to contents of aRefToList
--return aRef
tell aRef --tell to a range of text only
set prevContent to contents -- get the contents of the reference
as text
--set textProps to properties -- get all the text properties
set contents to "AAA" -- change the contents of the reference,
this will change the text in the document
end tell
end repeat
end tell
end tell
--return textRefList
--return textContentList