Changing window focus on OS X

Posted by MatsT on Stack Overflow See other posts from Stack Overflow or by MatsT
Published on 2010-06-09T13:59:32Z Indexed on 2010/06/09 14:02 UTC
Read the original article Hit count: 167

Filed under:
|
|

As part of an InstallationCheck script on OS X I need to use finder dialogs to let the user browse for files. When I'm done I want to move the installer application up front again so that the user can easily continue with the installation.

I have already tried the simple:

tell application "Installer" to activate

This does not work because as long as I am inside the script the Installer application is unresponsive and when i try to activate it the applescript will try to wait until Installer responds, effectively locking the program until the InstallationCheck script times out.

So basically I need a way to focus an application that works even if it is currently unresponsive. Is there any way to do this either from an applescript or directly from the perl script?

© Stack Overflow or respective owner

Related posts about perl

Related posts about osx