【问题标题】:Applescript keystroke capitalises some charactersApplescript 击键将某些字符大写
【发布时间】:2017-05-17 20:25:27
【问题描述】:
127  ;-(Tue Jan 03 22:27:09 Mac mini  ~
$   echo 'tell application "System Events" to keystroke "Changeme@123"'|osascript
CHAN

0  :-)Tue Jan 03 22:27:17 Mac mini  ~
$  CHANgeme@123

$  zsh
Mac mini% echo 'tell application "System Events" to keystroke "Changeme@123"'|osascript

CHa%
Mac mini% CHaNgeme@123

知道是什么导致某些字母大写吗?如果第一个字符是大写的,这似乎会发生。

【问题讨论】:

标签: bash macos applescript zsh osascript


【解决方案1】:

不知道为什么,但是如果您想要临时解决方法,这可行:

#!/bin/bash
osascript <<EOF
tell application "System Events" to keystroke "C"
tell application "System Events" to keystroke "h"
tell application "System Events" to keystroke "a"
tell application "System Events" to keystroke "n"
tell application "System Events" to keystroke "g"
tell application "System Events" to keystroke "e"
tell application "System Events" to keystroke "M"
tell application "System Events" to keystroke "e"
tell application "System Events" to keystroke "@"
tell application "System Events" to keystroke "1"
tell application "System Events" to keystroke "2"
tell application "System Events" to keystroke "3"
EOF

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-01
    • 2011-11-30
    • 1970-01-01
    • 2018-10-21
    • 2017-08-07
    • 2017-11-05
    • 2023-03-08
    • 1970-01-01
    相关资源
    最近更新 更多