我正在 shell 脚本中运行以下行:
osascript -e 'tell application "System Events" to keystroke "$1"'
我希望能够使用 applescript 键入 $1。有没有办法让 $1 作为我在脚本之后在终端中输入的内容出现?现在,它只需按字面意思输入 $1。
最佳答案
将它们放在单引号中,就像这样 -
osascript -e 'tell application "System Events" to keystroke '$1''
关于bash - 多个引号内的 Shell 脚本变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8306570/