Quark: add frame around text

Hi,
As I am starting with Mac, AppleScript and Quark I would ask someone to help.
I want to add a frame around a few paragraphs selected inside a text box.
My idea was to create a transparent picture box, with black frame and no wrapping style (no runaround text).

My question : how to get the bounds of the selected text?
Here’s my code:


tell application "QuarkXPress Passportª"
  set errNoSelection to "Select the text around which you want a frame"
  try
      tell front document
           set the selected_text to contents of selection
           set boxTop to top of bounds of selection
           set boxLeft to left of bounds of selection
           set boxHeight to height of bounds of selection
           set boxWidth to width of bounds of selection
			
           set NewBox to make new picture box at beginning with properties {bounds:({boxTop, boxLeft, boxHeight, boxWidth}), color:null, frame:{color:"black", style:solid, width:"1 pt"},runaround:none runaround}
      end tell	
   end try
end tell

Please HELP!

The short answer is that you don’t get the bounds of the selected text, Quark does not track such a thing. You will need to come up with a work-a-round based off of the properties of the text selected and use those in conjunction with the origin of the text box to figure out the bounds for the new picture box.