Re: On scripting Appleworks 6
Re: On scripting Appleworks 6
- Subject: Re: On scripting Appleworks 6
- From: Nigel Smith <email@hidden>
- Date: Tue, 13 Jul 2004 17:15:38 +0100
On 12/7/04 4:11, "email@hidden" <email@hidden> wrote:
>
Has anyone scripted Appleworks 6 to work with headers in word
>
processing documents? I want to change the first paragraph of the
>
header in a document, but I am not being allowed to, even though I can
>
read the header and change the whole header.
As soon as you use the "paragraph" keyword, it seems that commands are
redirected to the document body instead.
Quick way round this is to get the contents of the header, change the first
paragraph, then set the whole header to the new text:
--tested
tell application "AppleWorks 6"
tell document 1
set header to "foobar" & return & paragraphs 2 thru -1 of (get header)
end tell
end tell
--end
Note that the above will fail if you have a header with only one paragraph,
so you may want to build in some error checking :-)
HTH,
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.