Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Get Automator working again in iTunes 10' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Get Automator working again in iTunes 10
Authored by: asmeurer on Sep 04, '10 03:50:27PM

It's a good idea in general when checking version numbers to parse the version number into a format that will always sort correctly. For example, in languages where the list object sorts lexicographically (such as Python; does AppleScript do this?), you could parse a version such as 10.6.3 into [10, 6, 3]. Of course, unexpected extra letters or numbers can throw and well written code off, but it will be immune to things like a bump in the higher version number when you only expected bumps in the lower version number (such as comparing only the number after the dot, so 3.0 evaluates less than 2.5, because you were only expecting 2.6, 2.7, 2.8, etc.), or incorrect string comparisons when you add a new digit to one of the numbers, as demonstrated here.

[ Reply to This | # ]