PDA

View Full Version : Make application not steal focus




Henk Poley
Dec 17, 2011, 05:00 AM
Is it possible to make an OS X application stop stealing focus? After it has been built and shipped by a third party (so without sourcecode).

Scenario:
ScanSnap Manager is an application that sits windowless in the background, until you connect your scanner and press the hardware scan button. This opens a window showing the scanning progress, ergo steals focus [1]. This then shows the progress of processing steps, in a new window, ergo steals focus [2]. This then opens an application to handle the document, ergo steals focus [3].

All of these can be 'stopped' by setting the appropriate applications as 'LSBackgroundOnly' in their Info.plist. This has the side-effect on Scansnap Manager [1] & [2] that you have to kill the application and restart it after each scan. The document-handler [3] is just a throwaway processes that exits anyways, so for that it's not a problem.

Would it be possible to override the focus stealing for this group of apps, so it's not the most important application on your computer while the scanner is doing it's work (slowly and accurately)?



MorphingDragon
Dec 17, 2011, 05:22 AM
Is it possible to make an OS X application stop stealing focus? After it has been built and shipped by a third party (so without sourcecode).

Scenario:
ScanSnap Manager is an application that sits windowless in the background, until you connect your scanner and press the hardware scan button. This opens a window showing the scanning progress, ergo steals focus [1]. This then shows the progress of processing steps, in a new window, ergo steals focus [2]. This then opens an application to handle the document, ergo steals focus [3].

All of these can be 'stopped' by setting the appropriate applications as 'LSBackgroundOnly' in their Info.plist. This has the side-effect on Scansnap Manager [1] & [2] that you have to kill the application and restart it after each scan. The document-handler [3] is just a throwaway processes that exits anyways, so for that it's not a problem.

Would it be possible to override the focus stealing for this group of apps, so it's not the most important application on your computer while the scanner is doing it's work (slowly and accurately)?

AFAIK you can't override Cocoa behaviors outside source code. I would suggest contacting the developer for a feature request.

Blakeasd
Dec 17, 2011, 10:13 PM
There may be a way to do it in AppleScript or The Accessibility API, (maybe even the Quartz Window System) but I'm not positive... Just look up the documentation to each of these

Good Luck!