AppleScript 或 Automator 用于单击应用程序中的菜单? [英] AppleScript or Automator to click on menus in an application?

查看:28
本文介绍了AppleScript 或 Automator 用于单击应用程序中的菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定这是否可以通过 AppleScript 和/或 Automator 实现……但我希望能够:

I'm not sure if this is do-able via AppleScript and/or Automator…but I'd like to be able to:

a) 启动应用程序(我知道这可以通过 AppleScript 或 Automator 轻松完成)

b) 应用程序启动后,使用 AppleScript 或 Automator 选择特定菜单项.

例如我想启动 Excel 2008(我有没有为 Automator 预先配置的家庭/学生版),然后单击文件"菜单并单击打开".

e.g. I'd like to launch Excel 2008 (I have the home/student edition which doesn't come preconfigured for Automator) and then click the "File" menu and click on "open".

任何关于去哪里/寻找如何选择这样的菜单项的指示(或者甚至可能)?

Any pointers on where to go/look for how to select menu items like this (or if it's even possible at all)?

您可以使用 Automator 的 Record 功能有点"做到这一点,但 Record 非常脆弱.

You can "sort of" do this using Automator's Record function, but Record is very brittle.

我宁愿能够使用 AppleScript 简单地获取一个数组",其中包含应用程序的每个菜单项,然后以编程方式单击我的数组中的第 0 个菜单项……等等.等

I'd rather be able to use AppleScript to simply grab an "array" that contains every menu item for the application and then programmatically click on the 0th menu item in my array…etc. etc.

这可能吗?

TIA

推荐答案

我不知道如何抓取数组,但这看起来可能适用于发送鼠标点击等:

I don't know about grabbing an array, but this looks like it might work for sending the mouse clicks, etc:

虚拟输入

这篇关于AppleScript 或 Automator 用于单击应用程序中的菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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