As part of a bigger script I’m trying to make a new text box in QuarkXpress with this measurements, X:7 , Y:224 , W:9 , H:4 .
Also I need to give it a format to use a given font, size and left justified, and black as the color of the text.
I don’t know what I’m doing wrong, I keep getting error “error “QuarkXPress got an error: Can’t make class text box.” number -2710 from text box to class”
This is my script.
tell application "QuarkXPress"
tell layer "Default" of page 1 of front document
make new text box at beginning with properties {bounds:{"7 mm", "224 mm", "9 mm", "4 mm"}}
select last text box
bring to front
end tell
end tell
Sorry but you really need to read the application’s dictionary and understand how the objects hierarchy works. AppleScript is not simply a couple of verbs and terms expressing what you want. It’s a little bit more than that. There is a syntax, there are commands, classes, enumerations, etc. That’s all what the dictionary is about.
Bring to front has no meaning in QuarkXPress dictionary. Box bounds refer to Top, Left, Bottom, Right sides of the box so you cannot even set a box width or height that simple. Do maths prior to setting box properties.
HTH.
Sorry for the newbie question. I missunderstood the bounds parameters of text boxes.
If anyone is interested I found this useful link. http://www.mactech.com/articles/mactech/Vol.22/22.10/2210AppleScript/index.html
The other lines should be commented. Were part of my “to do” list.
Thank you CMYS, your observation was not rude at all. Everything working ok now.