Scripting BBEdit
Scripting BBEdit
- Subject: Scripting BBEdit
- From: Peter Mathiessen <email@hidden>
- Date: Wed, 06 Dec 2000 14:59:55 +0100
Hi,
I have a couple of thousand files that I need to make some changes to. I
need to make a script that deletes a certain line in each html-file.
The problem is that my script deletes the whole line, not just a part of it
that I want it to do.
The html-file
<TR>
<TD><H2>This line should remain and not be deleted</H2>This line should
be deleted</TD>
</TR>
The script:
tell application "BBEdit" to activate
set searchFolder to "Macintosh HD:remove text:"
set myList to list folder alias searchFolder without invisibles
repeat with myFilename in every item in myList
set myFile to alias (searchFolder & myFilename)
tell application "BBEdit"
open myFile
Go To Line 2
Select Current Line
Delete Selection
end tell
end repeat
Any thoughts?