Check for System version

Similar to Check for AppleScript version. Checks for the minimum required system version. Returns a boolean. Should be compatible with any OS version.

Note that if specific AS functionality is required, scripts should explicitly check for the AS version rather than assuming anything from the system version.

OS version: Any

--  minOSVers -- by Richard Morton 2004 --
--  Determine if the OS version is sufficient
--  Pass a 3 or 4 (for OS X) digit number corresponding to the minimum version required

--USAGE: set haveOS1035 to minOSVers at 1035
--> true -- if running OS 10.3.5 or higher, otherwise false

--Input: integer - three or four digit number representing the minimum system version required, e.g. 860 for OS 8.6; 1026 for OS 10.2.6
--Output: boolean - true if the system version is that or higher, otherwise false.

on minOSVers at reqVers
	set numList to characters of (reqVers as string)
	set decNum to 0
	repeat with num in numList
		set decNum to (16 * decNum) + num
	end repeat
	set sysv to (system attribute "sysv")
	if sysv < decNum then return false
	return true
end minOSVers