Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the version of a product




On Mon, 28 Feb 2005 11:34:37 -0500, "francois.houle" wrote:

I saw in the Finder's AS dictionary that you can check for the version of a
product... I just can't figure out how to ge tit to work.
The line of the dictionary is:
product version Unicode text [r/o] -- the version of the product (visible
at the top of the ³Get Info² window)
And its located under Class File : A File

As already noted, 'product version' seems to be very patchy - and it's difficult to find anything other than empty strings being returned. The 'version' property seems more promising, although it may contain a tad more text than you'd prefer. While the 'getNumOf' handler below is rather rough and ready, it may help you get started on a method of cleaning up things a bit:


on getNumOf(t)
	repeat with w in t's words
		if w's character 1 is in "0123456789" then return w's contents
	end repeat
end getNumOf

set theFile to choose file of type {"APPL"}
tell application "Finder"
set vers to theFile's product version
if (count vers) is 0 then set vers to my getNumOf(get theFile's version)
end tell
-- do something with vers


---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.