False result with NSProcessInfo

I’m on macOS 12.6.1. The following script returns 10.16 as the system version. Is it a known issue?

use framework "Foundation"
set fullVersion to (current application's NSProcessInfo's processInfo()'s operatingSystemVersionString())

This is really weird:

use framework "Foundation"

current application's NSDictionary's dictionaryWithContentsOfFile:"/System/Library/CoreServices/SystemVersion.plist"

Also returns 10.16 yet the pref file contains:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ProductBuildVersion</key>
	<string>21G217</string>
	<key>ProductCopyright</key>
	<string>1983-2022 Apple Inc.</string>
	<key>ProductName</key>
	<string>macOS</string>
	<key>ProductUserVisibleVersion</key>
	<string>12.6.1</string>
	<key>ProductVersion</key>
	<string>12.6.1</string>
	<key>iOSSupportVersion</key>
	<string>15.7</string>
</dict>
</plist>

I made further investigations:
I get this wrong result when running the script from SD7.
But if launched from FastScripts or Script Editor, the result is correct.

Odd, very odd…

If it’s SD7 only, it’s probably an artefact of the version of the OS it was compiled under. Back in the 10.x days, there was an assumption in some frameworks that only x would be changing. From memory, macOS 11 reported 10.x on Intel and 11.x on Apple silicon.

Hi Shane,

I found a file located at:/System/Library/CoreServices/SystemVersionCompat.plist
Here is its contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ProductBuildVersion</key>
	<string>21G217</string>
	<key>ProductCopyright</key>
	<string>1983-2022 Apple Inc.</string>
	<key>ProductName</key>
	<string>Mac OS X</string>
	<key>ProductUserVisibleVersion</key>
	<string>10.16</string>
	<key>ProductVersion</key>
	<string>10.16</string>
	<key>iOSSupportVersion</key>
	<string>15.7</string>
</dict>
</plist>

That’s exactly the results I get from SD7.

So you’re running on Apple silicon? Looks like a Rosetta issue.

Nope. Intel Mac (Mac Pro late 2013).

OK, so still Intel processor.

Just installed SD8. As you said, it was a compilation issue.
But that, you already know.