Re: add a paragraph to the beginning of a doc
Re: add a paragraph to the beginning of a doc
- Subject: Re: add a paragraph to the beginning of a doc
- From: Michelle Steiner <email@hidden>
- Date: Tue, 19 Jun 2001 17:14:24 -0700
On 6/19/01 3:18 PM, email@hidden <email@hidden> wrote:
>
I am writing a script for BBEdit. The file that is being editing in BBEdit
>
is a MS Word file. I am trying to insert a paragraph at the beginning with:
>
set first paragraph of document to "Filename" & Return
>
>
This gives the following error "Can't set paragraph 1 of document to
>
"Filename".
>
>
I have tried "set selection to insertion point..." and even "make new
>
paragraph..." The rest of my script, replacing characters and saving the
>
file, works great. What am I missing? Any ideas?
I couldn't figure out how to do it with BBEdit's scripting dictionary,
but here's a kludge that works.
tell application "BBEdit 6.1"
set the windowtext to the text of the front window
set the text of the front window to my insertpara(windowtext, "Filename"
& return)
end tell
on insertpara(windowtext, insertText)
set the newtext to insertText & the windowtext
return the newtext
end insertpara
I'm sure that it can be done with BBEdit, but I can't figure out how.
"put a before b" generates an error saying that before is not an
acceptable word there--nor is "in front of".
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------