• 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: Installer script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installer script


  • Subject: Re: Installer script
  • From: Harald E Brandt <email@hidden>
  • Date: Sun, 1 Sep 2002 16:35:58 +0200

+--> JJ wrote 02-09-01:
(alias (path to system folder) as text) & "System"
short version of (info for result)
--> i. e., "E1-9.2.2"


tell application "Finder"
set sysv to computer "sysv" -- or system attribute "sysv"
end tell
set majorversion to sysv div 256
--> i.e., 9
set minorversion to (sysv mod 256) div 16
--> i.e., 2
+-

Great, except it gives wrong result for OS 10, requiring a minor fix.
This works fine for all:

tell application "Finder" to set sysv to system attribute "sysv"
set majorversion to sysv div 4096 & (sysv mod 4096) div 256 as string as integer
set minorversion to (sysv mod 256) div 16
set subminorversion to (sysv mod 16)

if subminorversion > 0 then
"" & majorversion & "." & minorversion & "." & subminorversion
else
"" & majorversion & "." & minorversion
end if
set OSversion to "System version: " & result

if majorversion > 9 then
alias ((path to system folder as text) & "system")
short version of (info for result)
set OSversion to OSversion & return & "Classic version: " & result
end if
display dialog OSversion


__________________________BragIt___________________________
Harald E Brandt email@hidden http://bragit.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Installer script (From: JJ <email@hidden>)

  • Prev by Date: Re: Installer script
  • Next by Date: Re: scriptable would be a start
  • Previous by thread: Re: Installer script
  • Next by thread: Re: Installer script
  • Index(es):
    • Date
    • Thread