Re: how to test bundle versions string?
Re: how to test bundle versions string?
- Subject: Re: how to test bundle versions string?
- From: Christopher Nebel <email@hidden>
- Date: Mon, 17 Mar 2014 16:52:42 -0700
Right, because “CFBundleShortVersionString” is merely the key name — it’s not even a defined identifier, let alone a method or property of “current application”. You missed the built-in solution: “application” objects in AppleScript have a “version” property, so you could just do this:
(version of current application) as text
However, if you want to do things the Objective-C way, you’d get the value of that key from the main bundle’s Info.plist, like this:
NSBundle's mainBundle()'s objectForInfoDictionaryKey:("CFBundleShortVersionString”)
You may find it simpler to track the “CFBundleVersion”, which is intended to be a build number, so it’s typically just an integer. If you’re going to do that, you’ll have to use the Objective-C method, since AppleScript has no built-in support for it.
—Chris N.
On Mar 16, 2014, at 5:43 AM, phil03 <email@hidden> wrote:
> So I discovered the constant "CFBundleShortVersionString" but my attempts to use it have been thwarted.
>
> This doesn't work, for example:
>
> set myVersionNum to current application's CFBundleShortVersionString
>
> I tried coercing to string and text to no avail.
>
> On 16/03/2014 19:20, phil03 wrote:
>
>> I'm trying to implement a "check for software updates" function in my ASObjC app.
>>
>> I'm more or less there, except I'm not quite sure how to query the current version number in my info.plist from within my application's script.
>>
>> Suppose I have the newest version number in an html file which I call using curl. I display a dialog prompting the user to update if the version number curl returns is higher than the version number of the calling script.
>>
>> How do I get the bundles current version number into a property in the script to test against what's returned by curl?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden