Hi
i try to do a script with a variable wich set the value on the OSX version.
how i can link my variable set osx_version to … ???
thanks
Hi
i try to do a script with a variable wich set the value on the OSX version.
how i can link my variable set osx_version to … ???
thanks
Hi,
system attribute "sysv"
returns the system version number hexadecimal encoded.
You could use this
set majorVersion to (system attribute "sysv") mod 256 div 16
if majorVersion is 5 then
display dialog "You're running Leopard"
else if majorVersion is 6 then
display dialog "You're running Snow Leopard"
else
display dialog "You're running neither Leopard nor Snow Leopard"
end if
perfect ! thanks !
so, i have an other question…
i want to set an application to this result but…
when i put a variable as tell application, this not identify the software
set majorVersion to (system attribute "sysv") mod 256 div 16
if majorVersion is 5 then
set QT_version to "QuickTime Player"
else if majorVersion is 6 then
set QT_version to "QuickTime 7"
end if
tell application QT_version
-- here i put action from quicktime
end tell
2 things.
For example, if you’re compiling the script on 10.6 then you would do this…
set majorVersion to (system attribute "sysv") mod 256 div 16
if majorVersion is 5 then
set QT_version to "QuickTime Player"
else if majorVersion is 6 then
set QT_version to "QuickTime Player 7"
end if
using terms from application "QuickTime Player 7"
tell application QT_version
-- here i put action from quicktime
end tell
end using terms from
This way it will compile on 10.6 because you told it what application to use to check the syntax of the script and it will run on both 10.5 and 10.6 because your “tell application” statement will be correct. There’s one caveat when you do things this way. Obviously this script won’t compile on 10.5 because 10.5 doesn’t have QuickTime Player 7. As such you have to make sure the script doesn’t need to be compiled on 10.5. You can do that by saving the script as an application because applications don’t need to be compiled before they run… they’re already compiled.
it’s exactly what i wanted to know/do
thanks for your answer, very usefull
but if i can term from 10.6 quicktime, that can’t work on 10.5 right ?
it will not find the application
Read what I wrote again. I mention that the “using terms from” clause does nothing once the script is compiled. Then give it a try and see what happens.
ok i see, i’ve try but i’m on 10.5 so i can’t test it on 10.6 but that still work
thanks again