1
ri0day OP 解决了:一定要把QQ这个应用设置到frontmost ,也就是focus到当前的app 窗口上
tell application "QQ" to activate tell application "System Events" to set frontmost of process "QQ" to true tell application "System Events" keystroke "password" keystroke return end tell |