Re: How to determine FCP version
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3h/6L9iZyMD5saaYZmSilaCyosl/4zmKfcB6AaWeWBY=; b=lwKxzterH8i5+O7FjQXqlR3ebxSGJ/2hdSGZRO0MDpO08o0evgMPjc2JXZXFtdcZuH GnUJe3wEBzj+8eKJsfpI6qureQO2Ivo1IthuQd4Qd2f4lRW97hyqQtr3604mrbdggWQ6 2JSexrNeZVQv4Q1pVeVVXYibu6IBQ6UVe0QI0= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=IKqhHHQvVpLdDJBsePcNmRhdMvlkkhgyLm1DlUf/RdHd0ZF9oz7ucp2XIJjEgige3e fl78bq/eFq9rXf2V0s6H7nXCO6nFhWaZEgrpdI2JLOWq+5TDZeq4HJTgxwlokMiStLuE 3rhsoLu+mzv3uFeC14Beq955kVueepJQpZ6NU= Sounds like a robust solution, but apparently the bundle has to exist before you can call CFBundleGetBundleWithIdentifier. For future generations (and for feedback), here is some code that has worked at least once. :) - (NSString *) determineFCPVersion { // Returns the version number of Final Cut Pro in x.y.z format #define bID "com.apple.FinalCutPro" CFURLRef outAppURL; Str255 s; OSStatus status; NumVersion version; // Get the URL for FCP status = LSFindApplicationForInfo (kLSUnknownCreator, CFSTR(bID), NULL, NULL, &outAppURL); if (status != noErr) @throw [NSException exceptionWithName:@"Failed to get CFURLRef for" reason:[NSString stringWithCString:bID] userInfo:nil]; // Create a bundle for FCP CFBundleRef bRef = CFBundleCreate(kCFAllocatorDefault, outAppURL); if (!bRef) @throw [NSException exceptionWithName:@"Failed to get bundle ref for" reason:[NSString stringWithCString:bID] userInfo:nil]; // Get the version info from the bundle *((UInt32*)&version) = CFBundleGetVersionNumber(bRef); if ((version.minorAndBugRev & 0x0F) != 0) { sprintf( (char*)s, "%d.%d.%d", version.majorRev, version.minorAndBugRev >> 4, version.minorAndBugRev & 0x0F ); } else { sprintf( (char*)s, "%d.%d", version.majorRev, version.minorAndBugRev >> 4 ); } return [NSString stringWithCString:(char *)s]; #undef bID } Bruce On Sun, Apr 26, 2009 at 10:11 AM, Darrin Cardani <dcardani@apple.com> wrote:
An easier way is to use CFBundleGetVersionNumber (). You can call CGBundleGetBundleWithIdentifier (CFSTR ("com.apple.finalcutpro")) to get the CFBundleRef, then call CFBundleGetVersionNumber () with it. Darrin On Apr 24, 2009, at 11:49 PM, Andreas Kiel wrote:
Hi Bruce, How was NAB? Here a "stupid but fast" solution from terminal "defaults read /Applications/Final\ Cut\ Pro.app/Contents/Info CFBundleVersion" to get the FCP version Regards Andreas On 25.04.2009, at 08:10, Bruce Sharpe wrote:
Actually the solution I outlined below is no good: the first time the effects are requested from FCP 6, it takes a loooong time to return from the call, with lots of status messages flashing by.
So I'm still looking for a solution.
Bruce
On Fri, Apr 24, 2009 at 10:33 PM, Bruce Sharpe <bruce.sharpe@gmail.com> wrote:
To clarify, I am only interested in distinguishing between version 5 and version 6 or later. So far I am requesting the list of all effects, an event that is not supported by version 5. If the data size of the reply event is 0 I assume the version is 5. If it is greater than 0, then I conclude it is version 6 or later.
Just wondering if there is something more straightforward and a little less weird.
Bruce
On Fri, Apr 24, 2009 at 9:13 PM, Bruce Sharpe <bruce.sharpe@gmail.com> wrote:
Is there a recommended way to determine what version of FCP is running, using Apple Events? I've tried a couple of things but am not satisfied with the speed/reliability.
Bruce
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/kiel%40spherico.com This email sent to kiel@spherico.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com
This email sent to dcardani@apple.com
-- Darrin Cardani dcardani@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bruce Sharpe