Re: Line spacing in Appleworks
Re: Line spacing in Appleworks
- Subject: Re: Line spacing in Appleworks
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 5 Nov 2008 18:30:48 +0100
On 5 nov. 2008, at 16:54, Mark Ratledge wrote:
Anyone know how to script paragraph line spacing in Appleworks?
I'm following the scripting dictionary, but this line throws an
"unknown object type" error:
set line spacing of the selection to 1
The rest of the script - to change font, size, and style of
selected text - works fine.
I've also tried making a paragraph style and changing that with
Applescript, but line spacing can't be set in the paragraph
attributes within a style.
- Mark
I ran this script to get the exact structure of the property.
tell application "AppleWorks 6"
activate
tell document 1
get properties of paragraph 3
get line spacing of paragraph 3
get value of line spacing of paragraph 3
-- 0 = line spacing 1 line
-- 1 = line spacing 1.5 line
-- 2 = line spacing 2 lines
-- 3 = line spacing 2.5 lines
-- 4 = line spacing 3 lines
-- formula (lineSpacing -1)*2
set line spacing of paragraph 3 to {class:ruler measurement info,
value:6, unit:lines}
end tell
end tell
The Event Log is:
tell application "AppleWorks 6"
activate
get properties of paragraph 3 of document 1
{class:paragraph, index:3,
character offset:2,
paragraph index:3,
page index:1,
section index:1,
length:92,
color:{0, 0, 0},
font:"Helvetica",
size:12,
style:{class:text style info, on styles:{plain}, off styles:{bold,
italic, underline, outline, shadow, condensed, expanded,
strikethrough, superscript, subscript, superior, inferior, double
underline}},
uniform styles:{class:text style info, on styles:{plain}, off styles:
{bold, italic, underline, outline, shadow, condensed, expanded,
strikethrough, superscript, subscript, superior, inferior, double
underline}},
level:1,
label:none,
justification:left,
left indent:{class:ruler measurement info, value:0, unit:points},
right indent:{class:ruler measurement info, value:0, unit:points},
first line indent:{class:ruler measurement info, value:0, unit:points},
line spacing:{class:ruler measurement info, value:0, unit:lines},
space before:{class:ruler measurement info, value:0, unit:points},
space after:{class:ruler measurement info, value:0, unit:points},
paragraph style:"Corps"}
get line spacing of paragraph 3 of document 1
{class:ruler measurement info, value:4, unit:lines}
get value of line spacing of paragraph 3 of document 1
4
end tell
Given that, at this time, I was unable to revert the process to set
the value.
I returned to the dictionary and found:
ruler measurement info n : a fixed value and its unit of measurement
properties
value (real, r/o) : the amount
unit (lines/inches/millimeters/centimeters/picas/points, r/o) : the
unit of measurement applied to the value.
So, the game is over: as the value is read only, we can't change it.
Yvan KOENIG (from FRANCE mercredi 5 novembre 2008 18:30:44)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden