Hi Fred,
As Craig suggests best to learn Lua and look toward the future.
The Mach3 scripts are written in Cypress Enable which is a subset of Visual Basic. It is almost identical to VB but, as you are aware, there are some important differences.
DoOemButton(169) is the equivalent of pressing an on-screen button which will close the current file.
You will find the OemButton codes and Cypress Enable documentation in the Members Documents section of the forum.
Tweakie.