Quark-setting tab list in style spec

Hi
I’m forced to do something in QXP 4.11 (and hence OS9)
I can make a new style spec and give it properties except for the tab list
I have tried variations on:

  make new style spec at end with properties  {name:"CommentStyle", next style:style spec "CommentStyle",  character style:character spec "CommentText",  paragraph attributes:  {left indent:"1.611"", first indent:"-1.611"",   tab list:{{justification:left, fill character:" ", position:"1.648""}}}}

and it does everything but the tabs.
Anyone have any brilliant insights into what it is that I’ve missed?

thanks

rhb

I tried your code and got a similar problem. It doesn’t seem to want to let you define the tab list specifications.

One thing to try: add the word justified after left in the justification parameter. (This didn’t work for me, though).

However, you can retroactively set the tab list of a paragraph itself with this bit of code:

set tab list of paragraph 1 to {{justification:left justified, fill character:" ", position:"1.648""}}

Guy

thanks for the reply. I suppose I could do this in a loop, but it does rather defeat the whole point of styles. I wonder why we can’t do it.

rhb

I have had the same problem. You must first set the tab list to a variable. This will give you a list of records. Each item of the list is a record for each tab in the paragraph. I am on a PC at home so I am going on memory here but I think it is something like this. Lets assume you have two tab settings in the paragraph. We are going to change the settings of the first tab and add a new, third tab.

set tab_list to tab list --get the tab list
set position of item 1 of tab_list to “92.05 mm” – change position of 1st tab
set justification of item 1 of tab_list to centered – change justification
set new_tab to {justification:right justified, fill character:" ", position:“105 mm”
copy new_tab to end of tab_list – add new tab to end of list
set tab list to tab_list – set the tab list

I know I don’t have all the tell blocks but I don’t have a lot of time right now. This technique worked last week flawlessly.

I tried the variable thing when I tried to create the new style sheet the first time. It appears the tab list is a read-only property within the style sheet.

Interestingly, if I physically set the Normal style sheet to have a left tab at 1.648", then create the style sheet with this code:

tell application "QuarkXPress™"
	tell document 1
		set x to make new style spec at end with properties {name:"CommentStyle", paragraph attributes:{left indent:"1.611"", first indent:"-1.611"", tab list:{{justification:left justified, fill character:" ", position:"2""}}}}
		make character spec at end with properties {name:"CommentStyleChar", «class CATR»:{color:"Black", font:"Monaco"}}
		set character style of x to character spec "CommentStyleChar"
end tell
end tell

I get a style sheet with the tab at 1.648" instead of 2". Weird. At this point, I can retrieve the tab list of the style sheet and see the parameters but I can’t retroactively change them.

:oops: There’s got to a solution, you would think…

Guy

Thanks for the replies
I tried Grspur’s method and it does get a tab into the style, but for me it just put the
position to the same value as Normal and didn’t change it.

I wonder if Drossi had tabs in his Normal.
Drossi I’d really like to see some code for this. :slight_smile:

thanks again

rhb

I don’t think that setting up tabs in the style spec works in v4. Here is the word from S. Hopkins’s “Applescripting QXP”:

“This should work for versions 4.04 and 4.11, but to date I have not been successful.”

Guess you’ll have to set up the tabs another way.

thanks for the replies. I think Dennis has it right that it just doesn’t work.