Scripting a BBEdit Find with JXA

I have not figured out how to do a JXA script to Find and Find and Replace in BBEdit.

This little snippet fails miserably:

bb = Application(“BBEdit”)
result = bb.windows[0].find(‘Ancient Rome’,{options:{searchMode:‘grep’}})

This snippet gets a result, but also an odd Search Results window in BBEdit:

bb = Application(‘BBEdit’)
doc = bb.windows[0].text.contents()
result = bb.replace(‘Sublime’, {using:‘Mystery’,searchingIn:doc,option:{searchMode:‘grep’}})

Result: {“found”:true, “matchListWindow”:Application(“BBEdit”).searchResultsBrowsers.byName(“Search Results (Sublime)”)}

I feel like I have tried every configutation of syntax possible. I could stick with the AppleScripts that work very well, but it’s a matter of curiosity.

I am hoping someone can give me a clue.

Thanks,
Jesse