Re: Naming Quark boxes - screwed up!
Re: Naming Quark boxes - screwed up!
- Subject: Re: Naming Quark boxes - screwed up!
- From: Hans Haesler <email@hidden>
- Date: Tue, 17 Apr 2001 21:25:43 +0200
On Tue, 17 Apr 2001, Steve Kump wrote:
[snip]
>
When I select a single box and run this script, it always names SEVERAL
>
different, unrelated boxes! WHY? I just want to name a few boxes by
>
selecting them, and then running one of 10 scripts that names up to 10
>
boxes, picture boxes really.
Steve,
first of all: which version of QuarkXPress are you using?
The mangled trademark (?) symbol in your first message could signify
that you're still with QXP 3.3x.
Okay, version 3.32 or 4.11 -- this wouldn't explain the behavior
you're describing. And I can't reproduce it.
And I don't quite understand what you want to do. If you want to name
one box after the other then you don't need to get neither the
object reference nor the index. Just say:
---
tell document 1 of application "QuarkXPress 4.11"
tell current box
set name to "hello"
end tell
end tell
---
I guess that you want to name several selected boxes with the same name.
Then you can set a variable to their object references by including only
the boxes 'whose selected is true'. Then you must loop through them and
name one at a time:
---
tell document 1 of application "QuarkXPress 4.11"
set boxRef to object reference of every generic box whose selected is true
if class of boxRef is not list then set boxRef to {boxRef}
repeat with aBox in boxRef
tell aBox
set name to "hello"
end tell
end repeat
end tell
---
Regards,
Hans
---
Hans Haesler | email@hidden