• 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: Permitting a script to only run on OS X Yosemite
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: JavaScript for Automation curiosity (was "Script that "Tells" Finder just Focuses on Finder instead of running")
  • Next by Date: [ANN] DisplayDroid - Beta testers wanted
  • Previous by thread: Re: Permitting a script to only run on OS X Yosemite
  • Next by thread: Need helps with my script
  • Index(es):
    • Date
    • Thread