I recorded an Applescript via the "Start Recording" menu item in
BBEdit. I performed a few grep search/replace actions and this was the
resulting script which fails to run:
tell application "BBEdit"
activate
open find_window
replace "^\\[.*\\]\\s+" using "" searching in text 1 of text document
"untitled text 2" options {search mode:grep, starting at top:true,
wrap around:false, backwards:false, case sensitive:false, match
words:false, extend selection:false}
open find_window
replace "\\r^.*online.*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
open find_window
replace "\\r^.*offline.*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*Second Life:.*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*(Telepathy).*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*RCS-.*$" using "" searching in text 1 of text document
"untitled text 2" options {search mode:grep, starting at top:true,
wrap around:false, backwards:false, case sensitive:false, match
words:false, extend selection:false}
replace "\\r^.*HPC-Teleporter.*$" using "" searching in text 1 of
text document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*teleport-list.*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*Lightning Grip:.*$" using "" searching in text 1 of
text document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
replace "\\r^.*AO (Wear Me).*$" using "" searching in text 1 of text
document "untitled text 2" options {search mode:grep, starting at
top:true, wrap around:false, backwards:false, case sensitive:false,
match words:false, extend selection:false}
end tell
Why does this not work? How do I fix it?
First I had to remove the find_window part. Then it would still say:
BBEdit got an error: "^\\[.*\\]\\s+" doesnÂ’t understand the replace
message. What the heck?
Seriously how do I fix this? I've been reading a book on Applescript
but it's just greek to me. I can program in Java and C but this makes
no sense.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem,
please email "support@barebones.com" rather than posting to the group.
-~----------~----~----~----~------~----~------~--~-