Re: AppleWorks 6: how do you set text style?
Re: AppleWorks 6: how do you set text style?
- Subject: Re: AppleWorks 6: how do you set text style?
- From: Donald Hall <email@hidden>
- Date: Sat, 27 Sep 2003 22:38:54 -0600
Thanks, Dale. A very useful suggestion.
I got the style working fine. Next I tried to set tab stops, but
there seems to be a bug in AW. Even trying to get the existing tab
stops causes the program to crash. Mr. Tea suggested using a
stationery document, which a am looking into.
Don
At 2:52 PM -0700 2003/09/27, email@hidden wrote:
Hi Donald and Mr Tea
Another useful way to work out how to manipulate text in AppleWorks is to
find the properties of a selection (see below). Script Editor's result
window will show a lot of info about the selectio, helping you can to
work out how to change the properties.
tell application "AppleWorks 6"
get properties of selection
end tell
Cheers
Dale
On Fri, 26 Sep 2003 10:12:00 -0700,
email@hidden
Subject: Re: AppleWorks 6: how do you set text style?
From: Mr Tea <email@hidden>
To: AS Users <email@hidden>
This from Donald Hall - dated 26/9/03 7:15 am:
> How do I make paragraph 1 bold (or any other style for that matter)?
Hi, Donald
Adapting from your script....
set theText to "The beginning." & return & "The end."
tell application "AppleWorks 6"
activate
set theDoc to make new document with data theText
tell front document
tell paragraph 1
set size to 24
set style to {class:text style info, on styles:{bold, underline}}
end tell
end tell
end tell
The AW dictionary also allows for 'off styles' to be set, but you don't
need
that, just set the on styles and every other style will be off by default
(eg, on styles:{plain} restores text to an unstyled state.)
A good way to approach this sort of 'how do I find out the syntax'
problem
is to get the existing paramaters of the element you want to manipulate -
ie, do something like this in a 'feeler' version of the script...
tell application "AppleWorks 6"
activate
set theDoc to make new document with data "Test"
tell paragraph 1 of document 1
set styl to style
end tell
end tell
Your script editor's results window can be very informative in this kind
of
situation.
>
Nick
pp Mr Tea
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.