To close a Dialog Frame in versions GMS1.x the script function was selfobject.GetFrameWindow().WindowClose(0)
Since versions GMS2.x a different function has to be used selfobject.Close()
For scripts working in all versions of DigitalMicrograph I therefore need a way to figure out what is the version of GMS.
The only note i found was "Private:Configuration:ApplicationVersion", but I could not quite figure out what the number there means.
Unfortunately there doesn't exist a command to get the DM version. (Well, there exists one in later GMS versions now, but that is of no help.)
One "trick" how to work around this is shown in the tutorials on this page:
One can use the command
DoesFunctionExist()
to query if a specific script functions exists. If one uses a command which has been introduced with a specific GMS version, this can be used as a "minimum-version" test. For example, the commandDoesFunctionExist("Notes")
can be used to check if the version is at least GMS 2.0 (which introduced theNotes()
command.)