Re: Quark Style Sheets
Re: Quark Style Sheets
- Subject: Re: Quark Style Sheets
- From: Hans Haesler <email@hidden>
- Date: Sat, 16 Jun 2001 14:57:50 +0200
On Fri, 15 Jun 2001, Steve Suranie wrote:
>
I wanted to set some style sheets in Quark from AppleScript. Can someone
>
post the correct syntax to set the properties, i.e. rule above, space after
>
= x, etc.
Hi Steve,
you don't say which version you're using. That's very important,
especially regarding scripting Style specs.
With QXP 3.32 there is no problem.
With QXP 4.x you're (half) out of luck: creating/modifying Style specs
is broken, i.e. you can create Style specs, but you must create
a Character spec for each one and that's complete nonsense! Character
specs should only be used to modifiy _portions_ of text _inside_ of
paragraphs.
However, if you plan to modify existing Style specs and you limit
these actions to the Paragraph attributes then it can be done.
Here is how to get an idea of how to address the different attributes.
Make a document, create (manually) a Style spec and run this:
---
tell document 1 of application "QuarkXPress 4.11"
paragraph attributes of style spec 2
end tell
---
The result window shows the properties of the paragraph attributes.
You can a set variable to one single value:
---
tell document 1 of application "QuarkXPress 4.11"
set spA to space after of (get paragraph attributes of style spec 2) as text
end tell
---
The 'get' is necessary (except for the style spec "Normal") and the
'as text' is coercing the result (whose class is 'vertical measurement'
to a string).
If you'd like to get more than one value then you should set a variable
to the attributes and address the variable:
---
tell document 1 of application "QuarkXPress 4.11"
set parAttr to paragraph attributes of style spec 2
tell parAttr
set lead to leading as text
set ruleA to width of rule above as text
set ruleB to width of rule below as text
end tell
{lead, ruleA, ruleB}
end tell
-->{"15 pt", "0.5 pt", "0.5 pt"}
And here is how you set the properties:
---
tell document 1 of application "QuarkXPress 4.11"
activate
tell style spec "test"
tell paragraph attributes
set properties to {leading:15, space before:"p8.5", space after:"p2.8", rule below:{rule on:true, width:0.5, position:"p5.7"}}
end tell
end tell
end tell
---
You don't need to set all properties. Only those you want to change.
HTH,
Hans
---
Hans Haesler | email@hidden