How to close the main screen programmatically

My ScreenMaker application is hidden from the ABB menu, because it makes no sense to display it except when required by the rapid program. (see

The main screen is displayed from Rapid using UIShow and has three buttons to allow the operator to choose between 'Option 1', 'Option 2' or 'Quit'.

After use the screen remains on display despite having no further function.

Assigning the ScreenClose action to the buttons does not cause the screen to close.

Is there a way to close the screen other than having the operator close it manually?

Thanks for any advice,