Handle dialog box in Mac2 driver

I am using Mac2 driver to automate macosx app.
In one of the case, a dialog box open where I want to select ok.
I tried with this
driver.switchTo().alert().accept();

but I am running into this error

This is the error I am seeing
[debug] [WD Proxy] Matched ‘/wd/hub/session/5dbede2c-65e3-43ea-a3e0-0365077cc62e/alert/text’ to command name ‘getAlertText’
[debug] [WD Proxy] Proxying [GET /wd/hub/session/5dbede2c-65e3-43ea-a3e0-0365077cc62e/alert/text] to [GET http://127.0.0.1:10100/session/CB01FA6A-A9AE-4FE9-A4E5-0CFA7D875ACC/alert/text] with no body
[WD Proxy] Got response with status 404: {“value”:{“error”:“unknown command”,“message”:“Unhandled endpoint: /session/CB01FA6A-A9AE-4FE9-A4E5-0CFA7D875ACC/alert/text – http://127.0.0.1:10100/ with parameters {\n wildcards = (\n “session/CB01FA6A-A9AE-4FE9-A4E5-0CFA7D875ACC/alert/text”\n );\n}”,“traceback”:""},“sessionId”:“CB01FA6A-A9AE-4FE9-A4E5-0CFA7D875ACC”}
[debug] [W3C] Matched W3C error code ‘unknown command’ to UnknownCommandError

Any idea on how to fix this

mac2 driver does not implement alert interfaces because there is no way in XCTest to distinguish alerts from other elements. Try to locate alert buttons and click them as you would normally do with other app elements if they are present in the app source. If they don’t then I’d try to use AppleScript snippet as a possible workaround

I fixed it with doing
driver.switchTo.activeElement()