Hi,
I am developing a Final Cut Pro workflow extension. I would like to upload a Final Cut Pro video with the extension. As far as I understand both the macOS app and the extension are sandboxed and the user doesn't have a direct access to the Final Cut Pro folders. Here there is a described way to receive media through a custom share destination.
So far I have been able to parse the XML describing the video after dragging the video from FCP and dropping it in the extension. I have the URL of the video but no access to it - permissions denied.
Can I programmatically acquire access to the folder/ file in question? Or have the user allow access at the beginning and use it later?
Or should I use custom shared destination for that purpose?
Thank you in advance!
Post
Replies
Boosts
Views
Activity
I am using an NSOperationQueue for an upload task.
self.operationQueue = [[NSOperationQueue alloc] init];
self.operationQueue.maxConcurrentOperationCount = 5;
There are two types of tasks - UploadChunkTask and FinalTask (NSOperation subclasses). I'd like the FinalTask to start after all the UploadChunkTasks are finished. So I add the tasks for chunk uploads as dependencies to the final task:
FinalTask *finalOperation = [[FinalTask alloc] init];
for (int i = 0; i < self.file.numberOfChunks; i++) {
		UploadChunkTask *uploadOperation = [[UploadChunkTask alloc] initWithFile:self.file andChunkNumber:i+1];
		[uploadOperations addObject:uploadOperation];
		[finalOperation addDependency:uploadOperation];
}
[uploadOperations addObject:finalOperation];
And finally I add the tasks to an NSOperationQueue:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
		
		[self.operationQueue addOperations:uploadOperations waitUntilFinished:YES];
		
		dispatch_async(dispatch_get_main_queue(), ^{
				completion();
		});
});
The problem is that the final task does not respect the dependency and gets executed with the other tasks (instead of waiting for them to finish first). This happens even if there is just one upload task. The final task is sometimes executed before the upload task. I noticed this issue disappears if maxConcurrentOperationCount is set to 1, but I need it to be set to 5. Thank you in advance.
The users of the software of the company I work in can download videos from there, then use Final Cut Pro X to process them, and then upload them. It would be great if importing and exporting videos from and to the projects can be done directly from Final Cut Pro X. From what I understand to achieve that we should use workflow extensions. Is that correct? I know that there is also the possibility to make plugins for Final Cut Pro X with FxPlug but these plugins seem to be for creating effects, and don’t seem applicable in this case, but please correct me if I’m wrong.As far as I understand workflow extensions are extensions to macOS apps. Does someone have more information on how they are developed? For example in Xcode there is no Final Cut Pro X extension option. I requested more information from Apple like a month ago, but am still waiting for response. I cannot post any code of what I tried, because I wouldn’t know where to begin.BTW I know about the drag and drop options between FCP and another macOS app and also the usage of Apple events and custom share destination, bu the idea is though not to leave Final Cut Pro for this.Any help would be appreciated.