在 OS X 上更改窗口焦点
作为 OS X 上 InstallationCheck 脚本的一部分,需要使用查找器对话框来让用户浏览文件。完成后,我想再次将安装程序应用程序移到前面,以便用户可以轻松地继续安装。
我已经尝试过简单的方法:
tell application "Installer" to activate
这不起作用,因为只要我在脚本内,安装程序应用程序就没有响应,当我尝试激活它时,applescript 将尝试等待,直到安装程序响应,从而有效锁定程序,直到 InstallationCheck 脚本超时。
所以基本上我需要一种方法来集中应用程序,即使它当前没有响应也能工作。有什么方法可以从 applescript 或直接从 perl 脚本执行此操作吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下
你也可以尝试这样的事情
try
you could also try something like this