在AppleScript的,我怎么能得到帮助菜单的搜索领域,如Spotlight? [英] In Applescript, how can I get to the Help menu Search field, like Spotlight?

查看:208
本文介绍了在AppleScript的,我怎么能得到帮助菜单的搜索领域,如Spotlight?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OS X中,为了在键盘菜单项来快速搞定了,我希望能够输入一个组合键,它已经运行一个脚本,并有脚本集中在帮助菜单中的搜索字段。它应该只是像射灯组合键,所以如果我再次运行它,它应该驳回菜单。我可以用水银运行脚本,但我怎么能写剧本?

In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu. It should work just like the key combination for Spotlight, so if I run it again, it should dismiss the menu. I can run the script with Quicksilver, but how can I write the script?

推荐答案

下面是我想出了这个脚本。

Here is the script I came up with.

tell application "System Events"
    tell (first process whose frontmost is true)
        click menu "Help" of menu bar 1
    end tell
end tell

这篇关于在AppleScript的,我怎么能得到帮助菜单的搜索领域,如Spotlight?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆