Gotcha.
With all the quoting and such it can be very hard to read the code, and this method greatly facilitates debugging.
-------------------------------------------------------------------------------------------
set shCMD to "echo \"I'm a command\"!"
# DEBUG
bbeditNewDoc(shCMD, true)
return
do shell script shCMD
-------------------------------------------------------------------------------------------
--ยป HANDLERS
-------------------------------------------------------------------------------------------
on bbeditNewDoc(_text, _activate)
tell application "BBEdit"
set newDoc to make new document with properties {text:_text, bounds:{0, 44, 1920, 1200}}
tell newDoc
select insertion point before its text
end tell
if _activate = true or _activate = 1 or _activate = "activate" then activate
end tell
end bbeditNewDoc
-------------------------------------------------------------------------------------------
Not only is it easier to eyeball this way, but from BBEdit (or TextWrangler) I can plop in a shebang line and run it to make certain it's working properly.