adding a paragraph - part 2
adding a paragraph - part 2
- Subject: adding a paragraph - part 2
- From: email@hidden
- Date: Wed, 20 Jun 2001 17:33:57 -0500
Thanks, this code worked. What I do not understand is, why. If I run it
without the tell and end tell, it errors out on the "before". Why is the
tell needed? I thought it was still working in BBEdit (see below.*) It seems
like I could not find a word specifying location (before, after...) that
BBEdit liked.
Specs:
BBEdit 6.1.2
OS 8.5.1
Applescript 1.3.4/1.1
Applescript library 1.2.2
* This is a copy of the complete working script:
set workFile to (choose file with prompt "Select file:")
tell application "Bidet 6.1"
open workFile
replace "===" using "" searching in text 1 of text window 1 options
{search mode:literal, starting at top:true, wrap around:false,
reverse:false, case sensitive:false, match words:false, extend
selection:false} --ACSII linebreak
replace " " using """ searching in text 1 of text window 1
options {search mode:literal, starting at top:true, wrap around:false,
reverse:false, case sensitive:false, match words:false, extend
selection:false} --ACSII multi-valued field delimiter
replace "[[" using " " searching in text 1 of text window 1
options {search mode:literal, starting at top:true, wrap around:false,
reverse:false, case sensitive:false, match words:false, extend
selection:false}
tell window 1
copy ("Filename Description Keywords") & return to
before character 1
end tell
close first window saving yes
quit
end tell
>
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?
tell application "BBEdit 6.1"
tell window 1
copy ("Filename" & return) to before character 1
end tell
end tell