RE: Quark Scripting
RE: Quark Scripting
- Subject: RE: Quark Scripting
- From: Hans Haesler <email@hidden>
- Date: Sat, 2 Dec 2000 12:33:51 +0100
On Fri, 1 Dec 2000, Graham Sprague wrote:
>
Is it possible to get the name of an item using the "uniqueID" property of a
>
generic box in QuarkXpress. Note I have set the names of the selected boxes
>
with another script before I ran this one. Each time I get an error that
>
says can access the name of "202"(the uniqueID for the item)
Graham,
the next time, please, start a new thread (your message trails all
12 messages of applescript-users digest, Vol 2 #89).
Your script contains 'tell document 1'/'tell page 1' loops inside
of 'tell document 1'/'tell page 1' loops...
Here I've stripped out what you don't need. Note that you don't address
the box by repeating 'uniqueID'. Use just 'id':
---
tell document 1 of application "QuarkXPress 4.11"
tell page 1
set listID to uniqueID of every generic box whose selected is true
set dResult to display dialog "Enter Group Number:" default answer ""
if button returned of dResult is "OK" then
set groupNum to text returned of dResult
repeat with i from 1 to count of listID
set curID to item i of listID
set curName to (name of generic box id curID)
set lastChar to last character of curName
if curName contains "Copy" then
set (name of text box curName) to ("Copy Box " & groupNum)
else
set (name of picture box curName) to ("Image Box " & groupNum & lastChar)
end if
end repeat
end if
end tell
end tell
---
You could use the box type instead of the not very reliable uniqueID:
---
tell document 1 of application "QuarkXPress 4.11"
tell page 1
set objRef to object reference of every generic box whose selected is true
if class of objRef is not list then set objRef to {objRef}
set dResult to display dialog "Enter Group Number:" default answer ""
if button returned of dResult is "OK" then
set groupNum to text returned of dResult
repeat with aBox in objRef
tell aBox
set boxType to box type as text
set curName to name
set lastChar to last character of curName
if boxType = "TXTx" then
set name to ("Copy Box " & groupNum)
else if boxType = "PICx" then
set name to ("Image Box " & groupNum & lastChar)
end if
end tell
end repeat
end if
end tell
end tell
---
HTH,
Hans
---
Hans Haesler | email@hidden