I’m creating a plugin for Final Cut Pro and when I add the observable for the timeline it shows the popup asking for Automation permissions.
The problem is that the popup stays visible only for 1 second and dismisses itself automatically, adding the observable but it doesn’t have the permissions to get the data.
Here’s the code in question:
let host = ProExtensionHostSingleton() as! FCPXHost
if host.timeline != nil {
host.timeline!.add(timelineObserver)
}
Here’s what is inside of timelineObserver
:
class TimelineObserver: NSObject, FCPXTimelineObserver {
func activeSequenceChanged() {
let host = ProExtensionHostSingleton() as! FCPXHost
let hasTimeline: Bool = host.timeline?.activeSequence != nil
NotificationCenter.default.post(name: Notification.Name("timelineChanged"), object: nil, userInfo: ["hasTimeline": hasTimeline])
print("AAA", hasTimeline)
}
func playheadTimeChanged() {}
func sequenceTimeRangeChanged() {}
}
I know that the problem resides in the line host.timeline!.add(timelineObserver)
because removing it, stops the permission popup.
I want the popup to stay visible until the user clicks on it.
Luis Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.