Skip to content
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

Notification windows are not trackable and cause swindler to print errors #30

Open
thieso2 opened this issue Nov 15, 2018 · 3 comments
Open

Comments

@thieso2
Copy link

thieso2 commented Nov 15, 2018

When running an app that uses swindler I get the following whenever the NotoficationCenter displays a message:

Cannot convert property value nil to type String
Cannot convert property value nil to type Bool
Cannot convert property value nil to type Bool

Plus the windows created by NotoficationCenter are not visible/trackable in swindler.

Steps to reproduce - Start a swinder-enabled app and run

osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"'

to produce a notification from Terminal.

Expected behaviour would be not to get those error messages and being able to track the windows created by NotificationCenter.

@tmandry
Copy link
Owner

tmandry commented Nov 16, 2018

Thanks for reporting this. It looks like the issue comes from the window having a nil title. The booleans are probably also for the properties isMain/isFocused.

We could simply ignore these windows (with subrole AXNotificationCenterBanner). @thieso2 do you have a use case for tracking these windows? If so, I'm curious to know what it is. The windows cannot be moved or resized, to my knowledge.

@thieso2
Copy link
Author

thieso2 commented Nov 16, 2018

Hey @tmandry. We use swindler to instrument the OS to notify our app (kind of a VCR of your digital life) of noteworthy screen-updates.

Our use-cases are:

  • we want to know when "something" worth recording happens on the screen
  • we allow for playback of screen-recording with pixelating windows that are not in focus.

So we really want to know all about all windows that are shown at any moment, including the notification.
Hope that makes our intention clear.

Thank you open-sourcing your work!

@tmandry
Copy link
Owner

tmandry commented Nov 16, 2018

Got it. This isn't the exact use case I had in mind for Swindler; a Window is generally supposed to be something that behaves like a regular window. I'd be open to looking for ways that your use case can be supported, assuming it doesn't make Swindler harder to use.

That said, perhaps the easiest way is for you to AXSwift directly to watch for these notification windows. You should be able to use this alongside Swindler without any problems. Its API is more verbose, but it gives you more control than Swindler.

See this example for how to observe a particular application (run this and watch the console as you create, destroy, and move Finder windows.)

Do you think this will work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants