Re: Permitting a script to only run on OS X Yosemite
Re: Permitting a script to only run on OS X Yosemite
- Subject: Re: Permitting a script to only run on OS X Yosemite
- From: Nigel Garvey <email@hidden>
- Date: Mon, 05 Jan 2015 12:47:43 +0000
Daniel Chavez wrote on Mon, 05 Jan 2015 01:53:15 -0600:
>But I want to be able to tell the user that my script should only run if
>they have Yosemite.
>I tried
>considering numeric strings
> set _newEnough to _versionString ≥ “10.10.1"
>end considering
>I get the error
>The variable _versionString is not defined.
Hi.
Easily cured by setting the variable:
set _versionString to system version of (system info)
considering numeric strings
set _newEnough to (_versionString ≥ "10.10")
end considering
Brian Christmas wrote on Mon, 05 Jan 2015 19:36:35 +1100:
>tell application "Finder"
> set currentVersion to version as text
>end tell
>set tild to AppleScript's text item delimiters
>set AppleScript's text item delimiters to "."
>set theVersion to text item 2 of currentVersion
>set AppleScript's text item delimiters to tild
>
>if theVersion is "10" then
> display dialog "Yosemite"
>else
> display dialog "Not Yosemite"
>end if
Hi Brian.
This could be much simpler:
tell application "Finder"
set currentVersion to version
end tell
if (currentVersion begins with "10.10") then
display dialog "Yosemite"
else
display dialog "Not Yosemite"
end if
NG
_______________________________________________
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