Tech Tip: How to obtain the MacOS version number
PRODUCT: 4D | VERSION: 15.x | PLATFORM: Mac & Win
Published On: October 14, 2016
Here is a utility method to quickly obtain the MacOS version number (for example 10.11.6):
C_TEXT($0;$cmd;$in;$out;$err) $cmd:="sw_vers -productVersion" LAUNCH EXTERNAL PROCESS($cmd;$in;$out;$err) $0:=Replace string($out;Char(Line feed);"") |
If the code snippet above is saved as the UTIL_GetMacOSversion project method it could be used like this:
ALERT(UTIL_GetMacOSversion) |
An alternative command that would provide the same output is:
$cmd:="defaults read loginwindow SystemVersionStampAsString" |