--------------------------------------------------------
# dCre: 2021/10/21 10:33
# dMod: 2021/10/21 10:33
# Appl: BBEdit
# Task: Enclose All Instances of the Selected Word with Curly Braces.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Enclose,@Instances, @Selected, @Word, @Curly, @Braces
--------------------------------------------------------
tell application "BBEdit"
tell front text window's text
set theWord to the selection as text
set rePattern to "\\b" & theWord & "\\b"
replace rePattern using "\\{&\\}" options {search mode:grep, case sensitive:false, starting at top:true}
end tell
end tell
--------------------------------------------------------