Can you determine what OS is running?

Is there an Applescript statement that will tell me what OS is running? I will be running either 9.2.2 or Classic on Jaguar, but need to determine what version my program is running on at run time.

Thanks again all!



I think the Apple System Profiler (in the Utilities folder) may help you out. You may need different scripts for OS 9 and Mac OS X, but a try statement should solve the problem there.

Below the script I use when I report bugs with developers.


Bye for now,


– This part of the scripts launches the ASP and puts the report into a variable.

tell application “Apple System Profiler”
set newReport to system profile
set theReportText to newReport as text
close newReport saving no
end tell

– The 4 lines below put the report on the clipboard.

tell application “Finder”
set the clipboard to theReportText
end tell

do shell script “sw_vers”

For a “hybrid” solution:

Try the Applescript Resources routines at
There’s lots of other good stuff there, also.


which, of course, works well under Mac OS 9

ahh look at the name of the forum AppleScript | OS X :stuck_out_tongue:

There is also :

system attribute "sysv"

But don’t ask me how to decipher it I dont know, but willing to learn …