How to register app launch listener in javascript for automation - macos

I'm trying to build a script with javascript for automation to prevent certain applications from launching in OSX. In the documentation, there is a NSWorkspaceWillLaunchApplicationNotification notification. How can I listen for this notification, check which application is being launched, and then stop the application from launching?
I'd like to be able to do it programmatically because I'm building an app for people to be able to block timewasting applications while they're working.

Related

Is it possible to run GUI apps in headless Windows containers?

This question is similar to but different from Is it possible to run GUI apps in windows containers? in the following way: I do not wish to login and see the GUI. Instead, I would like to know if is possible to start a winforms or wpf application from the commandline inside of a Windows container. If it runs at all, what are the window/screen implications for the GUI application?
Perhaps I have an GUI application that starts listening on a port when a user clicks a button. And perhaps I want to test this application in an automated way, both with a script that triggers a GUI button click also running in the container, and a script that creates and runs a container with both the GUI app and the button clicker.

My windows phone application runs when ran though visual studio (onclick of device button) but when I disconnect and run it doesn't?

I have written file picker code in my project. When i run the project in my windows phone by clicking on device button in visual studio, the app runs fine(I mean it opens pictures library and i can select a photo and preview it).
But when I disconnect my usb and then open the app in the phone and when i open pictures library on click of a button , the pictures library opens briefly and then the app crashes immediately(My app closes).
Can anyone please help me with this??
As written in the blog post , the AndContinue method run in a different process and to do so, the current running app goes into the background or even gets closed sometimes, that is what you are experiencing in your app as far i can tell but not sure why different things happening during debug & deploy.
There must be a callback inside app.xaml.cs specifically to handle the condition when calling application(which was sent into background) comes in foreground, read this blog post carefully & you'll understand as what you need to change in your code :
using-the-andcontinue-methods-in-windows-phone
http://blogs.msdn.com/b/wsdevsol/archive/2014/05/08/using-the-andcontinue-methods-in-windows-phone-silverlight-8-1-apps.aspx
I just dealt with this issue and one of the reasons why there are differences between debug and deploy is because of the suspending event.
During debug, the application does not actually get suspended until you manually do it through Lifecycle Events. This means that when you pick a file on debug and the app is put to the background to load the file picker, it is not actually suspended, while when the app is deployed, it actually gets suspended.
Look into your app_resuming method and OnSuspending methods in your app.xaml that may be causing errors not occurring during debug.

Popup application under citrix

We are planning to develop an application that will run as a windows service that reads a DB for entries on a timer interval basis. whenever an entry is found the service opens shows a popup in the system try, something like lync or ocs.
My question is whether it is possible to deploy the windows service and the popup application under citrix xen app?
Man thanks
Yes you can do that, but you need to keep in mind how those popups will be consumed by a XenApp user. In particular how is the popup app going to get started?
If your users are using published desktops then you can put your popup app in the startup folder of your users so it will always launch and be running and everything will work fine. However if your users are running published apps then you should have the popup app published and get your users to run this published app.

Windows 8: Activating an app using Background task

I am doing a windows 8 App using c#. the app goes to suspend state if its inactive, I am trying to bring the app to front based on external events. So I used a background task with this app which monitors the external event. Once the event occurs I am able to send updates to the app but not able to bring it to front. any pointers will be helpful.

How to shutdown local tomcat server when closing browser window?

I hava a web app running on a local tomcat server.
When the user starts the app (via desktop shortcut) the server starts and the app is opened in a browser window.
But when the user just clicks on the close button to stop the application the server is still running in the background - that's annoying.
I tried to utilize the "unonload" and "onbeforeunload" events from javascript but unfortunately these events are also fired on some other requests in the app.
So I can't use them, except I do a lot of refactoring.
Does anyone have an idea for a possible solution?
Btw, what I find interesting is the behaviour of Visual Studio when debugging a web application. When I close the browser window Visual Studio also gets a trigger to stop debug mode. So it seems it somehow notices the close event of the browser window, which would be exactly what I need. But I don't know how they do it...
Can you wrap the starting of Tomcat and launching your app in a batch file or shell script? (Not sure what your target OS is...)
The script/batch file would start Tomcat and then launch your application. When the user exits your application, the script/batch file would then shut down Tomcat.
You can setup a short session timeout, and use a HttpSessionListener. On sessionDestroyed(..) you can stop tomcat (using catalina.bat for example) .
Otherwise you can try to detect browser close, and send a shutdown message to the server using ajax (before the browser is closed).

Resources