AlertWindow::showYesNoCancelBox & FileChooser

I’m trying to use a combination of the AlertWindow::showYesNoCancelBox and the FileChooser.

For example, I want to post the AlertWindow::showYesNoCancelBox to ask the user if they want to “save” vs. “save as”. If they select “save as”, I want to post a FileChooser.

The problem is that in the lambda in the AlertWindow::showYesNoCancelBox is where I would like to create the FileChooser, but the call to FileChooser::launchAsync doesn’t work as expected in this context since the lamda of AlertWindow::showYesNoCancelBox exits.

Is there a trick to get this to work?