txt properties in Quark?

I’m just getting started with scripting Quark. I got this far:

tell application "QuarkXPress Passport"
	make new project
	delete text box 1 of page 1 of document 1
	make at beginning of page 1 of document 1 with properties ¬
		{bounds:{"10.079mm", "12.7mm", "120.65mm", "82.742mm"}} new text box
	make at beginning of page 1 of document 1 with properties ¬
		{bounds:{"10.079mm", "82.742mm", "120.65mm", "160.277mm"}} new text  box
	set paragraph 1 of text box 2 of page 1 of document 1 to "Box 1"
	set paragraph 1 of text box 1 of page 1 of document 1 to "Box 2"
end tell

I’ve looked at the dictionary, but I’m hopeless at figuring out how
to set font and style properties. I would like to set the font, style, and color of the text “Box 1”, etc.
Can someone point me in the right direction?

Thanks.

Model: dual 2.7 G5
AppleScript: OS X 10.4.5
Browser: Safari 417.8
Operating System: Mac OS X (10.4)

I only have a second but this should get you started. I believe this needs to be in the tell document block, unless you want to stick with your format of adding “of document 1” at the end of each command.


tell front document  --or tell document 1
set properties of (story 1 of text box 1) to {font:"B Helvetica Bold", size:"5 pt", color:"Black"}
set justification of story 1 of text box 1 to right justified
end tell

Thanks for the info. This fails on the “story 1”, apparently story can’t take a number. But the other info was a big help.

Unfortunately, now I am kind of stuck. My company uses a template which apparently has custom colors already defined. Here is the property list:
{class:text, object reference:text from character 1 to character 330 of text box 3 of page 1 of document “01.13 Vienna” of application “QuarkXPress Passport”, base shift:“0 pt”, color:color spec “PANTONE 430 C” of document “01.13 Vienna” of application “QuarkXPress Passport”, font:“Arial”, horizontal scale:“100%”, shade:“100%”, size:“14 pt”, style:{class:text style info, on styles:{bold}, off styles:{plain, italic, underline, outline, shadow, superscript, subscript, superior, strikethrough, all caps, small caps, word underline}}, track:“0”, vertical scale:“100%”, ascent:“11.648 pt”, baseline:“3.596 mm”, character style:character spec “Normal” of document “01.13 Vienna” of application “QuarkXPress Passport”, descent:“3.367 pt”, height:“159 pt”, horizontal offset:“0 mm”, kern:“0”, length:330, offset:0, trap text:default, uniform styles:{class:text style info, on styles:{bold}, off styles:{plain, italic, underline, outline, shadow, superscript, subscript, superior, strikethrough, all caps, small caps, word underline}}, width:“501.026 mm”}

If I try to make a new document and assign the color to “PANTONE 430 C”, I get an error. I will have to either load the template each time, or figure out how to define a custom color.

Thanks again.

BTW, what is a “story” exactly, and how is it different than a paragraph.

Also, this works:

tell application "QuarkXPress Passport"
	make new project
	tell front document
		tell page 1
			tell text box 1
				set story 1 to "some text" -- works with either "paragraph" or "story"
				set properties of story 1 to {} -- ditto
				set justification of story 1 to right justified
			end tell
	end tell
end tell
end tell

But if I try to set either story 2 or paragraph 2, I get an error - any idea why?

This is a very comfy thing here - to call first a text box, and then story 1 of it. It’s better than calculating which number of the story you are going to talk to. One text box can have only one story. Story is a new text flow. In a document, there can be as much stories as text boxes, although often first are less, because some text boxes are linked with a chain tool and contain the story with the same number.
Talking to a story, you can speak to its 1st, 2nd, etc. paragraph. Paragraph is a class lower than a story, an item of text that is delimited by a return.

Sometimes it helps to select a text box in a publication and then command:

tell app “Quark”
tell document 1
set name of current box to “something”
end tell
end tell

after that, you can adress the story of this box as follows:

tell app “Quark”
tell document 1
tell story 1 of text box “something”

end tell
end tell
end tell

BTW, loads of info on Quark Scripting can be found in the Quark application folder on the hard drive. I have Quark 4.11 and in the program’s folder there’s a “Documents”->“Apple Events Scripting” directory in which there’s “Apple Events Scripting PrintMe”. There’s the object model and other things. Unfortunately, cannot say anything about Passport.
Good luck, - Evg.