Re: How to determine FCP version
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Greg 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; Bruce So I'm still looking for a solution. Bruce 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/greg%40intelligentassist... _______________________________________________ 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... It seems to work with NSBundle too, but you have to identify the bundle first. (Warning, the following code is RubyCocoa rather than Objective-C, but translation is easy). require 'osx/cocoa' fcp_path = OSX ::NSWorkspace .sharedWorkspace .absolutePathForAppBundleWithIdentifier("com.apple.FinalCutPro") fcp_bundle = OSX::NSBundle.bundleWithPath(fcp_path) fcp_version = fcp_bundle.objectForInfoDictionaryKey("CFBundleVersion").to_s // 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 } 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. 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. 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 This email sent to greg@intelligentassistance.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Gregory Clarke