Re: appleworks word processing text
Re: appleworks word processing text
- Subject: Re: appleworks word processing text
- From: Nigel Smith <email@hidden>
- Date: Mon, 23 Jun 2003 11:42:04 +0100
On 23/6/03 0:31, "David Tennant" <email@hidden> wrote:
>
I am not a programmer, but I've created a 75 page script that uses 500
>
fields from 9 relational databases in Filemaker Pro to create 4 page
>
written documents from scratch.
I'm assuming that you can't do what you want with FileMaker's Mail Merge
feature, or with a single calculated field on a letter layout...
>
If I use the "with data" syntax, I would have to set a variable and
>
continue updating that variable based on the conditions of the script
>
and the data from the database, at the end of which I would have to
>
plop that 4 page variable into a word processing document. After all
>
that, I would have to re-manipulate the data to set text styles and so
>
on. With MacWrite Pro, I can "put chars" line by line or word by word
>
and set text styles as I go. There must be a simpler way to create
>
text as the script analyzes each condition that it encounters.
Here's some demonstrations of text creation -- run the script and see how
the final AW document mtches with the lines of the script and you'll be able
to work out what is going on:
--Start script - watch the breaks!
tell application "AppleWorks 6"
set theDoc to make document at front with properties <no-break>
{document kind:text document}
tell document 1
set defaultTextProps to properties of paragraph 1
make new character at end with data "I"
make new character at end with data " "
make new word at end with properties {size:24, text:"am"}
make new text at end with data (" the first line." & return)
make new paragraph at end with properties <no-break>
{color:{65535, 0, 0}, size:12, font:"Chicago", <no-break>
text:("And I am a new paragraph." & return)}
make new paragraph at end with properties <no-break>
(defaultTextProps & {text:"And I am another paragraph."})
end tell
end tell
--end script
Note that properties set in one operation remain set until changed -- if you
add a word in a different font, that font remains "active" until you change
it back. Also, adding text as a word or paragraph doesn't mean that AW will
include spaces or returns, you'll have to add them yourselves.
Hope that helps,
Nigel
_______________________________________________
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.