• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What System?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What System?


  • Subject: Re: What System?
  • From: KOENIG Yvan <email@hidden>
  • Date: Tue, 23 Aug 2011 21:21:00 +0200

Le 23 août 2011 à 21:03, Christopher Stone a écrit :

> -- Based on research by Richard Morton in the early days of "Code Exchange". Script by Nigel Garvey
>
> -- The StandardAdditions's 'system attribute' used to be the Finder's 'computer' command.
> set sysv to (system attribute "sysv") mod 65536
>
> -- For most practical purposes, scripts can compare this number
> -- with some critical value worked out in advance.
>
> -- But for display:
> set hiDigit to sysv div 4096
> if (hiDigit > 0) then
> 	set hiDigit to hiDigit as string
> else
> 	set hiDigit to ""
> end if
> return hiDigit & sysv mod 4096 div 256 & "." & sysv mod 256 div 16 & "." & sysv mod 16


I am accustomed to this handler borrowed from an Apple script.

on quelOS()
	try
		(* «event fndrgstl» = forme canonique de system attribute *)
		-- set hexData to «event fndrgstl» "sysv"
		set {hexData, hexString} to {system attribute "sysv", {}}
		repeat 4 times
			set hexString to ((hexData mod 16) as string) & hexString
			set hexData to hexData div 16
		end repeat
		set OS_version to hexString as string
	on error
		set OS_version to "0000"
		(* retournera "0000" si "system attribute" n'est pas reconnu *)
	end try
	return OS_version
end quelOS

quelOS()

Yvan KOENIG (VALLAURIS, France) mardi 23 août 2011 21:20:55



 _______________________________________________
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

References: 
 >What System? (From: Robert Poland <email@hidden>)
 >Re: What System? (From: Luther Fuller <email@hidden>)
 >Re: What System? (From: Robert Poland <email@hidden>)
 >Re: What System? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: What System?
  • Next by Date: Re: What System?
  • Previous by thread: Re: What System?
  • Next by thread: Re: What System?
  • Index(es):
    • Date
    • Thread