Apply an existing H&J in Quark

I’m a noob to Applescript. I’m using OSX 10.3.9, Applescript 1.9.3, and Quark 6.5.

I’m looking for a way to apply an existing H&J to a story without having to apply a paragraph style with an H&J. In my workflow, I need to keep the bolds and italics in the imported text. Applying a paragraph style strips the bolds and italics.

I can think of two methods of setting the H&J:

Method 1) There may be some way of setting the H&J through a simple applescript command like:

set h and j spec to “No Caps body style”

I have not discovered this in the dictionary or on forums. If anyone has insight on how to do this, it will be appreciated.

Method 2) Selecting the H&J popup button in Quark’s Formats>Paragraph Attributes window. The problem I’ve encountered is that I get the formats>Paragraph Attributes window to come up…:

tell application "System Events"
keystroke "F" using {command down}
end tell

… but I don’t know the name of the H&J button or how to change it. Using Apple’s UI Element Inspector the button parents are labeled:

tell process "QuarkXPress"
tell window "Paragraph Attributes"
tell tab group
tell group
tell unknown
tell pop up button
delay 1
click menu item "No Caps"
end tell
end tell
end tell
end tell
end tell
end tell

This doesn’t work. If anyone knows a way of changing the H&J by clicking it via Applescript, please let me know.


AppleScript: 1.9.3
Browser: Firefox
Operating System: Mac OS X (10.3.9)

Hi there,

After trying a few things I managed to ‘get’ the value but couldn’t ‘set’ it in Q6.5.

Here’s the code to ‘get’ the value:-

tell application "QuarkXPress"
	tell front document
		get the h and j set of paragraph 1 of story 1 of current box
	end tell
end tell

The code below allows you to set the value in Q7 - big thanks go to Michel @

tell application "QuarkXPress"
	set DocName to name of document 1
	tell document DocName
		set HJ_Titles to object reference of h and j spec "Standard"
		tell text box 1
			tell paragraph 1
				set h and j set to HJ_Titles
			end tell
		end tell
	end tell
end tell



Model: Poewr PC G5
Browser: Safari 419.3
Operating System: Mac OS X (10.4)