Re: Determining OS Version
Re: Determining OS Version
- Subject: Re: Determining OS Version
- From: John Baltutis <email@hidden>
- Date: Sun, 24 Jan 2010 13:38:01 -0800
On 1/24/10, Marconi <email@hidden> wrote:
>
> Where on a bootable volume is the best place to find out the version
> of OS that is installed?
>
> I want to make a droplet which, when a bootable volume is dropped
> onto it, will tell me:
>
> APM | GUID
> OS version
> and
> PPC | Intel | Universal
This gives the OS version:
set vers to (do shell script "sw_vers -productVersion")
display dialog "This computer is running" & return & return & "MacOS X
version:" & vers buttons "OK" default button 1
This gives the OS build:
set vers to (do shell script "sw_vers -buildVersion")
display dialog "This computer is running" & return & return & "MacOS X Build
Version: " & vers buttons "OK" default button 1
This gives the OS version using the system attributes:
set the hexData to system attribute "sysv"
set hexString to {}
set hexString to ((hexData mod 16) as string) & hexString
set hexData to hexData div 16
set hexString to "." & ((hexData mod 16) asstring) & "." & hexString
set hexData to hexData div 16
repeat 2 times
set hexString to ((hexData mod 16) asstring) & hexString
set hexData to hexData div 16
end repeat
set the OS_version to hexString asstring
display dialog "The installed system version is " & OS_version
This gives the OS version and processor name:
set x to system info
set w to first word of system version of x
set y to first word of CPU type of x
display dialog w &return& y
Disks have partition schemes, not volumes, so dropping a bootable volume onto
your droplet needs to refer to the volume's parent disk. Disks and volumes have
no relationship to computer type: PPC or ICBM (Intel-chip-based Mac). Most
likely, your best bet for getting the partitioning scheme is to parse the
output from Apple System Profiler or the results from the do shell script
command and diskutil:
tellapplication "System Profiler"
get system profile
end tell
or
do shell script "diskutil list | grep partition"
Details are left as an exercise.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden