• 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: evalhate without parsing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: evalhate without parsing?


  • Subject: Re: evalhate without parsing?
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 02 May 2013 19:43:11 -0500

On May 02, 2013, at 17:27, Robert Poland <email@hidden> wrote:
So much for the easy way out…
______________________________________________________________________

Hey Bob,

Knowing that the Satimage naming convention for Smile has remained the same for a long time, I'd probably do something like this (very rough):

-------------------------------------------------------------------------------------------

on smileVer(_str)
set _digits to find text "[0-9.]+" in _str with regexp, all occurrences and string result
set _ver to item 1 of _digits
set _ver to change "." into "" in _ver
set _build to item 2 of _digits
return {_ver, _build}
end smileVer

set strA to "Smile 3.6.1 (build 710) full edition"
set strB to "Smile 3.10.0 (build 768) full edition"

set {ver1, _build1} to smileVer(strA)
set {ver2, _build2} to smileVer(strB)

if (ver2 as integer) > (ver1 as integer) then
# Download new version
true
else if (ver2 as integer) = (ver1 as integer) then
if (build2 as integer) > (build1 as integer) then
# Download new version
true
end if
end if

-------------------------------------------------------------------------------------------

Collapsing the dots ought to safely produce a number that can be evaluated.

--
Best Regards,
Chris

 _______________________________________________
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: 
 >evalhate without parsing? (From: Robert Poland <email@hidden>)
 >Re: evalhate without parsing? (From: Christopher Stone <email@hidden>)
 >Re: evalhate without parsing? (From: Christopher Stone <email@hidden>)
 >Re: evalhate without parsing? (From: Robert Poland <email@hidden>)
 >Re: evalhate without parsing? (From: Christopher Stone <email@hidden>)
 >Re: evalhate without parsing? (From: Robert Poland <email@hidden>)
 >Re: evalhate without parsing? (From: Christopher Stone <email@hidden>)
 >Re: evalhate without parsing? (From: Robert Poland <email@hidden>)

  • Prev by Date: Problems with Sound Studio 3
  • Next by Date: Re: uneditable [OT]
  • Previous by thread: Re: evalhate without parsing?
  • Next by thread: Please take me off your list
  • Index(es):
    • Date
    • Thread