首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Applescript键入

使用Applescript键入
EN

Stack Overflow用户
提问于 2011-10-05 20:34:20
回答 2查看 2.1K关注 0票数 0

是否可以使用applescript为您设置mac类型?我想要的是:编译时,此applescript将键入一个短语,然后按enter键。有没有模拟按键的代码?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-10-05 21:03:10

keystroke命令将为您工作。

代码语言:javascript
复制
tell application "System Events" to keystroke "A phrase" & return & "Another phrase"

如果你想让一个特定的应用程序来做打字工作,只需要按照下面的思路做一些事情:

代码语言:javascript
复制
tell application "System Events" to tell process "TextEdit" to keystroke "A phrase" & return & "Another phrase"
票数 4
EN

Stack Overflow用户

发布于 2011-10-05 21:15:48

可以,在System Events > Processes中查看击键和按键,但您必须打开Universal Access

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7661348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档