Change font of all Words before ":" in Quark

Hi all.

I have got this script to change the specs of a selection of text.
But… new to Applescript, I can’t figure out how to set the font of all the words before the “:” of every paragraph to Scala-Caps.

Anybody who knows a solution for this?

Then, another problem (see comments in last lines of script) is that I can’t set the language to Dutch, can’t set the stylesheet to “No styles” and it’s seems also impossible to change the h and j set.

tell application “QuarkXPress Passport”
tell document 1
tell selection

		--Wijzig letterspecificaties.
		set size of every paragraph to 8.5
		set font of every paragraph to "Scala-Regular"
		set kern of every paragraph to 0
		set base shift of every paragraph to 0
		set horizontal scale of every paragraph to 100
		set color of every paragraph to "Zwart"
		--Wijzig alineaspecificaties.
		set leading of every paragraph to 10.55
		set justification of every paragraph to left justified
		set left indent of every paragraph to 34.733
		set first indent of every paragraph to -4.233
		set right indent of every paragraph to 0
		set space before of every paragraph to 0
		set space after of every paragraph to 0
		set grid lock of every paragraph to false
		set keep all of every paragraph to false
		set tab list of every paragraph to {{justification:left justified, position:4.233}}
		set left indent of paragraph 1 to 34.733
		set first indent of paragraph 1 to -34.733
		set tab list of paragraph 1 to {{justification:left justified, position:30.5}}
		set size of word 1 of paragraph 1 to 12
		set font of word 1 of paragraph 1 to "Scala-Italic"
		--- Does not work in Quark 6/OS 10.3: set  style sheet of every paragraph to "Geen opmaak"
		--- Does not work in Quark 6/OS 10.3: set h and j set of every paragraph to "Vier om vier"
		--- Does not work in Quark 6/OS 10.3: set language of every paragraph to "Nederlands"
	end tell
end tell

end tell

Hi,

Your code minus the comments seems to work fine. I think you’ve got to refine where the styles are that you’re trying to establish though.

Word 1 of paragraph 1 is going to lose it’s formatting when you apply a paragraph style sheet to the entire paragraph. If you’re looking to style the paragraph one way and the first word another way, apply the paragraph style sheet, then change the first word.
–also, to set the style sheet of the paragraph to “none” use this…

set style sheet of every paragraph to null
set style sheet of every paragraph to "Geen opmaak"

You can narrow down the code by having the style sheet that you’re going to apply have all the styles defined within. Or you can define a new style sheet and set it’s properties…

tell application "QuarkXPress"
	tell front document
		make new style spec at end with properties {name:"Geen opmaak"}
		set properties of style spec "Geen opmaak" to {paragraph attributes:{h and j set:h and j spec "Vier om vier", first indent:"0", grid lock:false, keep all:false, leading:"10.55 pt"}, character attributes:{font:"Scala-Regula", size:"8.5 pt", color:"Zwart"}}
		tell selection
			set style sheet of every paragraph to null
			set style sheet of every paragraph to "Geen opmaak"
			set size of word 1 of paragraph 1 to 12
			set font of word 1 of paragraph 1 to "Scala-Italic"
		end tell
	end tell
end tell

I’m not sure about setting the language. That’s something I haven’t tried before. Other than that, let me know if this works for you.

good luck!

Browser: Safari 312.6
Operating System: Mac OS X (10.3.3)

Hi Kjeld

I think you have to have the language files in the application folder of quark, i assume you get the choice to have these on installation.
otherwise it defaults to U.S.English.
Once you have these installed i imagine there will be a lot more options open to you.

Hi Kjeld

To set the language to Dutch you have to take the number of the language not the name. I think Dutch is number 5

set language of every paragraph to 5