Re: X, Classic, or 9?
Re: X, Classic, or 9?
- Subject: Re: X, Classic, or 9?
- From: yvan-koenig <email@hidden>
- Date: Fri, 14 Jan 2005 09:28:12 +0100
Le 14 janv. 2005 , à 2:04, Gil Dawson a écrit :
I have three scripts which do the same thing:
the first works in 9.2.2 using Script Editor 1.8.3,
the second works in 10.3.7/Classic using Script Editor 1.8.3, and
the third works in 10.3.7 using Script Editor 2.0.
The syntax difference among these three is modest.
Can you think ofsomething to test at the beginning of the script to
tell which environment it is running in, so I'll need to keep only one
consolidated version?
--Gil
Hello
This piece of code may help.
-- [SCRIPT SS duplique SS]
(*
Yvan KOENIG, Vallauris (FRANCE)
le 9 janvier 2005
*)
on run
set versionOS to my quelOS()
if versionOS is "0000" then
set msg to "Very old OS"
else if versionOS is less than "1000" then
set msg to "recent OS 9"
else
set msg to "Mac OS X"
end if
display dialog msg
end run
-- ============= Routines
on quelOS()
try
(* «event fndrgstl» = forme canonique de system attribute *)
-- set hexData to «event fndrgstl» "sysv"
set hexData to «event fndrgstl» "sysv"
set hexString to {}
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
-- =============
Messages
-- [/SCRIPT]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden