Quark object reference query...

Hi Everyone,

Hopefully someone might be able to point me in the right direction with this query.
As yet I’ve not been able to come up with a solution.

Let’s say the text below is a line of copy in a Quark text box. The words in bold are coloured Magenta.
Here’s the line:-
The quick brown fox jumps over the lazy dog

I can create an object reference to the first and last words of the line like this:-

set x to object reference of every line of text box 1 whose color of first word is "Magenta"

set y to object reference of every line of text box 1 whose color of last word is "Magenta"

Those references work fine.

What I’d like to be able to do is create an object reference to a line of text where any word, in it, is coloured Magenta. As shown, I can only get this to work for the first and last words.

Is this possible?

Thanks.

Nick

Hi Nik

Does this work?
Not had much chance to test though .

tell application "QuarkXPress"
	tell document 1
		set x to object reference of every word of every line of text box 1 whose color is "Magenta"
	end tell
end tell

Hi Pidge,

Thanks for your time on this.

From just a quick play around it looks like it might be doing what I need. :slight_smile:

Cheers,

Nick

Just one further question on this.
Is it possible to pull out the line from this object reference?

Here is what I get returned:-

text from character 71 to character 76 of line 3 of text box 1 of document “test_doc” of application “QuarkXPress”

I think I can manage without, I just wondered if it was possible?

Thanks,

Nick

Hi Nik

if i understand what your after then it can be done but it ain’t very straight forward.

Doing a search on these forums you need to trap the reference as an error then use applescript delimiters to
extract the reference out of the resulting error message.

i reckon if you really really need this info then you might find yourself going round the houses a bit.

Do a search for “object reference”