• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: On scripting Appleworks 6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >On scripting Appleworks 6 (From: "email@hidden" <email@hidden>)

  • Prev by Date: Launching an AppleScript from a Local Browser Page
  • Next by Date: Re: Launching an AppleScript from a Local Browser Page
  • Previous by thread: On scripting Appleworks 6
  • Next by thread: AppleScript can't launch DVD Player on Mac OS X 10.2
  • Index(es):
    • Date
    • Thread