求一个脚本

2016-04-20 20:07:05 +08:00
 IgniteWhite

想要一个在 OS X 里实现类似 Windows “按键精灵”的脚本,内容是: 重复交替输入“ 1 ”和“ 2 ”,即输入“ 12121212 ……”

应该怎么做呢?用 AppleScript 之类的能写吗?还是用 shell 脚本?

1823 次点击
所在节点    macOS
6 条回复
fatestigma
2016-04-20 20:13:56 +08:00
tell application "System Events"
  repeat
    keystroke 1
    keystroke 2
  end repeat
end tell
IgniteWhite
2016-04-20 21:24:58 +08:00
@fatestigma 果然有大神出现!感谢!
cwlmxwb
2016-04-21 20:40:57 +08:00
穿越火线?
500miles
2016-04-21 22:21:35 +08:00
@fatestigma 这是重启电脑的节奏吗...
fatestigma
2016-04-22 08:28:39 +08:00
@500miles 什么意思,这个只是连续按压 1 、 2 两个键,没有其他功能了。如果你觉得它按得速度太快,可以在每个 keystroke 之前加一个 delay 。
IgniteWhite
2016-04-24 00:39:16 +08:00
@cwlmxwb Robocraft

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/272605

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX