Script problems with BBEdit 6.5
Script problems with BBEdit 6.5
- Subject: Script problems with BBEdit 6.5
- From: Craig Nansen <email@hidden>
- Date: Tue, 4 Dec 2001 18:57:02 -0600
This script works just great for me in BBEdit 5.1. I get all kinds of
errors when I try to use it with my newly installed BBEdit 6.5. Even
the simple "go to line 1" and "replace Every Occurrence" give errors.
Where do I find the major changes in scripting BBEdit 6.5?
tell application "BBEdit 5.1"
activate
--start at top and step through file
go to line 1
replace Every Occurrence searching for "
http://" using
"\\r
http://" with grep
remove line breaks
go to line 1
replace Every Occurrence searching for "\\r(http:.+\\r)\\r" using
"\\1" with grep
--start at top and step through file
go to line 1
set done to false
repeat until done
--Pattern for single lines ending with colon and return
set seek_pattern to "^[A-Z 0-9 . ' ( ) -]+:?\\r" as string
find seek_pattern with grep
if result is true then
change case Lower Case with selection only
change case Capitalize Words with selection only
--Remove colon in selection after fixing capitalization
replace Every Occurrence searching for ":\\r" using "\\r"
with selection only and grep
else
set done to true
end if
end repeat
end tell