Hi all, I am having an issue with my script. I receive an error (number -1700 from { } to integer) about 3/4 of the way through the script, at the point were I want to set the custBug to the object reference of the text box . Any tips would be appreciated. Thanks
tell application “QuarkXPress”
activate
–error checking
set checkVolumes to (list disks)
set textPath to {“Volumes:Public:Customer Artwork:CUST LIBRARY:ENVTXT:”} as string
set statList to {“A- BrushScript”, “B- FranklinGothic”, “C- Souvenir”, “D- UniversityRoman”, “E- Helvetica”, “F- KauflinKoffee”, “G- Optimum”, “H- CopperPlate”}
set stockList to {“CopperPlate”, “Helvetica”, “NewBaskerville”}
if (exists document 1) is true then
try
set workpath to ("" & (path to current user folder)) & "Desktop:" as text
tell application "QuarkXPress"
set filepath to workpath & "file.qxp"
save document 1 in filepath version 80
close document 1 saving no
delay 2
tell application "QuarkXPress" to open ((path to desktop) & "file.qxp")
end tell
end try
end if
delay 5
tell application "QuarkXPress"
display dialog "Enter Customer Number" with default answer
set custNumber to text returned of result
tell document "file.qxp"
set targetBox to {every text box whose selected is true}
end tell
if "errNum" = -1728 then
beep
display dialog "No text box selected" buttons {"Cancel"} with icon 0 default button 1
return
end if
end tell
tell application "QuarkXPress"
activate
set targetPage to targetBox
set custBug to object reference of (text box whose name is "EN0000") of page targetPage of "file.qxp"
set targetBug to object reference of ¬
(text box whose name is "ADDR") of page targetPage of "file.qxp"
set custBug to custNumber
end tell
end tell
–select styles
beep
display dialog " Stationery or Stock Styles?" buttons {“Stationery”, “Stock”}
if button returned of the result is “Stationery” then
set stationeryStyles to item 1 of (choose from list statList with prompt “Stationery” without multiple selections allowed)
else
set stockChoice to item 1 of (choose from list stockList with prompt "Stock " without multiple selections allowed)
end if
–format page
set importStyles to true
set custBug to “EN” & custNumber & “-” & (targetPage as text) as text
set textFormat to textPath & stationeryStyles or stockChoice as text
set targetBox to textPath
set story1 of targetBox to textFormat