Quark 4 to Quark 6 script error – Please help

javascript:emoticon(‘:cry:’)
Hi – I’ve compiled my script in OSX for Quark 6 but it doesn’t work. It works for Quark 4 in Classic. I’ve looked at it and compared it to the dictionary in Quark 6 and it looks OK to me. The script: if you click at the start of a paragraph with your mouse and highlight the text down, it draws a rule to the depth of the lines and paragraphs you have highlighted (so that it looks like the text is in a box when it really is covered by a rule so it is a quick way of drawing boxes over text).

The error I get is: QuarkXPress got an error: Can’t set rule below of paragraph 1 of selection of document 1 to {color:color spec “black” of document 1, left indent:“0 mm”, position:“p4”, right indent:“0 mm”, rule on:true, shade:“20”, style:solid, text length:false, width:233}.

The script:
tell application “QuarkXPress”
tell document 1
set theheight to (the height of the text of the selection) as integer
set rulewidth to (theheight - 9)
tell paragraph 1 of the selection
set the rule below to {color:color spec “black” of document 1 of application “QuarkXPress”, left indent:“0 mm”, position:“p4”, right indent:“0 mm”, rule on:true, shade:“20%”, style:solid, text length:false, width:rulewidth}
end tell
do updates
end tell
do updates
end tell

If you try this in Quark 4 you will find it works, in Quark 6 error! Please help.

I failed to note that it creates a shaded rule over the text to look like a shaded box and that if you look at the error I posted, it gives the number 233 at the very end. This is the depth the rule would be on the text I selected if the script worked. So the script has worked out the depth of the rule but can not draw it.

I’m in publishing and I’m working on a series of Bed and Breakfast and Hotel Guide books that are about 750 pages each with hundreds of boxes to highlight the establishments that are highly recommended.

Not too keen in Quark, but how does that create a “background”? Aren’t rules paragraph based? Won’t that just draw a thick line at the botton of the paragraph?

Anyway, try

tell paragraph 1 of the selection
set properties of rule below to {color:color spec “black” of document 1 of application “QuarkXPress”, left indent:“0 mm”, position:“p27”, right indent:“0 mm”, rule on:true, shade:“20%”, style:solid, text length:false, width:rulewidth}
end tell

N

Sorry for the delay in answering but I’m in England, UK and it was around 3.00 in the morning and I had to go to bed.

The first paragraph is only 1 line deep, it is a heading “Pick of B&Bs”. You highlight from that first line with your mouse all the lines and paragraphs that you want to place in a box. The script works out the depth of this highlighted text and draws a rule from the first line of the paragraph to the end of the last line you have highlighted (there could be for example 5 paragraphs within this highlighted text). A rule is drawn over the text (shaded so that you can see the text underneath), it can be changed in the script to any colour, so the text looks like it has been placed inside a coloured box, when infact it hasn’t it is just covered by the rule. This means that all the paragraphs are linked together in the file and are not in separated boxes. Also the time spent placing a box the correct size around the text you want can take say 1 minute, whilst the script does it in about 0.25 seconds. When you have hundreds of boxes the saving of time is enormous.

I tried the change in the script but unfortunately it didn’t work. Thanks for trying to help me.

OK, now you have my curiousity.

The script you provided DOESN’T work on Quark 4.11, but with the changes I noted it does work in 6.1 (both single language - I’m in the US).

And as I noted, when used it just draws a thick rule under each paragraph– no overlay, etc.

Can you post a link to a file? Or maybe PM me? I understand what you are saying, it’s just not happening on my end. I’d love to see a file.

Thanks,
N

I’m hoping to get into contact with you again Nedloh 99. You’ve been really helpful and it looks like you might have cracked my problem. I’ve done the change to the script as you have asked but it still doesn’t work. I’ve sent you 2 PM messages so I hope you can continue to help me.

Kelboy,

Opening your supplied file in xPress 4.11 gave me a missing xTension warning. It was looking for an xTension named “Tables”

Gluon makes an Xtension named TableMaker that (among other things) can do “background” colors.

I’m thinking that your original document was built with an older version or similar xTension, and the characteristics “stuck” with the document (even without the xTension).

I can use your script with your supplied doc in xPress 4.1 and it does what you say. If I use a new doc, it doesn’t work as I posted earlier. My version used in 6.1 creates a rule under each paragraph.

How would you manually do the same exact thing your script is doing? (assign “background” rules) I’m not so sure it’s possible without some special help - or some table based trickery (over my head!)

The easiest way that I would approach this is to use your measurements to create a colored box and send it to the background.

-N

Thanks for trying N

In Quark 5 and 6 there is a new way of creating tables in Quark. If you get a Quark 6 file and save it as a Quark 4 one, when you call the file up in Quark 4 then you always get that message because Quark 4 does not understand the new Quark way of producing tables. So the warning is because Quark 4 is old and Quark 6 is new. I saved my file from Quark 6 to Quark 4 for you.

Kelboy

Kelboy,
Took a step back and did a quick Quark review. (It seems your xPress and my xPress behave a bit differently- I get no warning on save downs, among other things)

The ability to do the “background” color has to do with the stylesheet properties. In the sample you sent me, the first paragraph selected has to be “Pick of Pub Head” and the following paras need to be based on the stylesheets with [box] in the name. Based on that, this works fine for me in QX6.

Let me know how you make out!

tell application “QuarkXPress”
tell document 1
set theheight to (the height of the text of the selection) as integer
set rulewidth to (theheight - 9)
set thePars to the selection
select paragraph 1 of the thePars
tell paragraph 1 of the thePars
set properties of rule below to {color:color spec “10M 30Y” of document 1 of application “QuarkXPress”, left indent:“0 mm”, position:“p4”, right indent:“0 mm”, rule on:true, shade:“100%”, style:solid, text length:false, width:rulewidth}
end tell
do updates
end tell
do updates
end tell

javascript:emoticon(‘:D’)
Thankyou, thankyou, thankyou N – times a billion!

Yes it works! How magnificent and clever of you to work that one out. I must thankyou yet again for all the time and effort you have put into making this script work - you have saved me countless hours of cursing Quark 6 and manually dropping lots of boxes on hundreds of pages. The pages get edited you see, so the text will run differently once edited, so manual boxes would all had have to been manually adjusted to align correctly again after the corrections, insertions and deletions that would occur from the editor of it!

If you are a woman … I love you and want to marry you!
If you are a man I want to slap you on the back and buy you a beer!

Forever grateful,
Kelboy

By the way I’m going to add just one more ask of help to this forum - you have a rest N you’ve done enough!