• 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: 10.4.9 versus 10.4.10
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 10.4.9 versus 10.4.10


  • Subject: Re: 10.4.9 versus 10.4.10
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 15 Mar 2008 22:10:48 +0100


Le 15 mars 2008 à 21:02, Paul Berkowitz a écrit :

try set v1 to system attribute "sys1" set v2 to system attribute "sys2" set v3 to system attribute "sys3" set v to (v1 as string) & "." & v2 & "." & v3 --> 10.4.11 on error set v0 to system attribute "sysv" set {v1, v0} to {v0 div (16 ^ 3), v0 mod (16 ^ 3)} set {v2, v0} to {v0 div (16 ^ 2), v0 mod (16 ^ 2)} set {v3, v4} to {v0 div (16 ^ 1), v0 mod (16 ^ 1)}

    set v to (v1 as string) & v2 & "." & v3 & "." & v4
    --> 10.3.9
end try


OK, now I have two soluces.

I just edited this one:

try
set v to (system attribute "sys1") & "." & system attribute "sys2" & "." & system attribute "sys3"
--> 10.4.11
on error
set v0 to system attribute "sysv"
set {v1, v0} to {v0 div (16 ^ 3), v0 mod (16 ^ 3)}
set {v2, v0} to {v0 div (16 ^ 2), v0 mod (16 ^ 2)}
set {v3, v4} to {v0 div (16 ^ 1), v0 mod (16 ^ 1)}


    set v to (v1 as string) & v2 & "." & v3 & "." & v4
    --> 10.3.9
end try

I just receive Michelle Steiner's one.

set text item delimiters to "."
set v1 to system attribute "sys1"
set v2 to system attribute "sys2"
set v3 to system attribute "sys3"
set v to (v1 & v2 & v3) as string

I would, at least, add:

set text item delimiters to ""

to leave the system clean.

Last detail, I was in fact working on a script dedicted to Pages 3.

I coded this way:

-- ==================

on controleVersion()
	local v
	try
		set v to version of application theApp
		if v < "3" then my mauvaiseVersion()  (* here Pages 2.x *)
	on error
		my mauvaiseVersion() (* here, Pages 1.x *)
	end try
(* Pages 3.x which means at least 10.4.10 *)
end controleVersion

-- ==================

on mauvaiseVersion()
if my quelleLangue() starts with "fr" then
error "Ce script requiert la présence" & return & "de Pages 3.0 ou supérieur." number 8001
else
error "This script must be used with" & return & "Pages 3.0 or higher." number 8001
end if
end mauvaiseVersion


-- ==================

on quelleLangue()
local z
try
set z to do shell script "defaults read 'Apple Global Domain' AppleLocale"
on error
set z to "en"
end try
return z
end quelleLangue


-- ==================

Yvan KOENIG _______________________________________________
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: 
 >Re: 10.4.9 versus 10.4.10 (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: 10.4.9 versus 10.4.10
  • Next by Date: Path to Document in Script Editor
  • Previous by thread: Re: 10.4.9 versus 10.4.10
  • Next by thread: Re: 10.4.9 versus 10.4.10
  • Index(es):
    • Date
    • Thread