New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a program to register for notification of context change #55
Comments
Say hello to NSDistributedNotificationCenter. No need for special registration functions or anything of the like, just post a certain notification to this class/instance/whatever and any registered app receives it. |
Looks great for apps that are running but what about non-running apps. Would it behave like scripting bridge/apple script and start the app? Nice find BTW. On Oct 3, 2011, at 7:37 AM, David Jennes wrote:
|
What I gathered from your description of the issue was that the app was already running. If it isn't, a simple openAction or shellScriptAction would do it, right? |
I'd like either to work. If the app that registers has some sort of helper app, like Time Machine's backupd-helper for example, then the app should be able to register that helper app as the app that needs the notification. On Oct 3, 2011, at 8:32 AM, David Jennes wrote:
|
Not sure I follow, mind explaining the situation a bit more? |
Sure. Let's say an app wants to be notified of a context change from ControlPlane so it registers with CP. There are then two ways CP can issue the notification:
I could just as easily call an external app but I was thinking of creating something that required a bit less thought and work to implement for the CP user. On Oct 3, 2011, at 8:32 AM, David Jennes wrote:
|
What about: On 03 Oct 2011, at 15:57, Dustin Rue wrote:
|
While it makes sense, I'd also like to avoid more system services running.
|
In this case, just look at the complexity difference between the method you propose and mine:
My proposal is essentially 2 or 3 method calls and quite simple/clean, while the registration way of working brings along all the trouble of keeping track of all registrars. Why re-invent the wheel when the DNC does everything for us? On 03 Oct 2011, at 16:05, Dustin Rue wrote:
|
"rejected" for 1.x.x series, lets put this is 2.x.x at some point |
I would like to suggest that this use the distributed notification center or already running apps. If an app needs to be started, it would make sense for it to be kicked off as an action. Is there a specific use-case that you had in mind that would need the notification of context change to notify if the app is already running and start it if it isn't? Fwiw, distributed notification center is how i was able to implement an action that would change synergy configurations depending on context, working with SynergyKM to store and change the configurations, while CP would have it change. |
Create a protocol for how a third party app can register for context change notifications. The target app should be able to tell CP that it wishes to be notified of changes and how it should be called. Two methods should be supported including a call to an external binary or via AppleScript. CP should call the external app or use AppleScript with a single argument, the current context.
The text was updated successfully, but these errors were encountered: