Make application not steal focus

Discussion in 'Mac Programming' started by Henk Poley, Dec 17, 2011.

  1. Henk Poley macrumors regular

    Sep 22, 2008
    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).

    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)?
  2. MorphingDragon macrumors 603


    Mar 27, 2009
    The World Inbetween
    AFAIK you can't override Cocoa behaviors outside source code. I would suggest contacting the developer for a feature request.
  3. Blakeasd macrumors 6502a

    Dec 29, 2009
    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!

Share This Page