Can you use KVO with Scripting Bridge

Can you use KVO with Scripting Bridge?

I want to know if I can create a script bridge interface for my application and allow notifying client applications by observing the object returned by one of my application SB commands.

Is it possible? If not, what is the alternative?

+3
source share
2 answers

Scenarios Bridge objects are just Cocoa-fragmented sugar around sending events to the application and receiving responses back. If you respect the property of an object, you do not send it any messages, so you do not send any events to the application. There is no way to observe something in the Apple Events system - you can send events and receive responses, and that’s it.

The only way to do what you want is to poll: Send the application an event every x seconds requesting the current state.

iTunes, , iTunes () , . Notification Watcher , , , .

+5

, , .

+1

Source: https://habr.com/ru/post/1767657/


All Articles