Re: > Naming Quark boxes - screwed up!
Re: > Naming Quark boxes - screwed up!
- Subject: Re: > Naming Quark boxes - screwed up!
- From: Greg Turnquist <email@hidden>
- Date: Tue, 17 Apr 2001 13:55:50 -0500
>
Naming Quark boxes - screwed up!
I tried yours it only renames the box I select. Below is one that I use.
tell application "QuarkXPress 4.1"
activate
if exists document 1 then
tell document 1
if current box is null then
display dialog "Please select a box first." buttons "OK"
with icon stop
else
if box type of current box is group box then
set theName to "" -- multiple selection may have
different names
set prompt to "Enter a name for the selected boxes"
else
set theName to name of current box
set idx to index of current box
set prompt to "Enter a new name for Box " & idx
end if
try
display dialog prompt default answer theName
if button returned of result is "OK" then
set newName to text returned of result
if box type of current box is group box then
-- unfortunately, the current spread may not
have the current selection
set n to count generic boxes -- of the whole
document
repeat with i from 1 to n
tell generic box i
if selected then set name to newName
end tell
end repeat
else
set name of current box to newName
end if
end if
end try
end if
end tell
else
display dialog "There is no document open." buttons "OK" with icon
stop
end if
end tell
I also did the following.
tell application "QuarkXPress 4.1"
activate
tell document 1
tell picture box named "Greg"
set image 1 to "Gregs:_Apple Scripts:myscripts:Book
scripts:book1999:impo stuff:epss:1.123456" as alias
end tell
(*set theBox to the object reference of the current box
set theIndex to the index of theBox
set name of generic box theIndex to "myname"
set curname to name of current box*)
end tell
end tell
Watch for line wraps.
Just as an thought I found that some Quark commands work better when you
tell Qaurk to activate.
Greg