bash - 在 macOS Mojave 上运行 osascript -e [command] 时出现奇怪的错误

标签 bash macos applescript osascript

我刚刚完成了 macOS Mojave 的全新安装(尽管重新安装了各种零碎的东西)并在运行 bash 脚本时遇到了一个奇怪的错误,该脚本又通过 osascript 运行 AppleScript。传递给 osascript -e 的任何命令似乎都会产生相同的错误,即使实际命令似乎已完成。

例如$ osascript -e '说“你好”'

错误是:

2018-12-03 22:35:26.301 osascript[39652:590470] isPrefsCreateCacheFromEnabledAndDefaultInputSources - can't find anything from GetInputSourceEnabledPrefs, use defaultASCIIKeyLayoutDict = {type = mutable dict, count = 3,
entries =>
0 : {contents = "InputSourceKind"} = {contents = "Keyboard Layout"}
1 : {contents = "KeyboardLayout ID"} = {value = +2, type = kCFNumberSInt64Type}
9 : {contents = "KeyboardLayout Name"} = British
}

通过 ScriptEditor 应用程序运行相同的命令工作正常。

使用系统 bash,在安装时配置一个键盘(英式)。

有人有同样的问题或知道问题出在哪里吗?

最佳答案

当我通过“系统偏好设置”>“键盘”>“输入源”添加额外的键盘时,问题就消失了。 (澳大利亚,如果有人感兴趣的话。)

移除额外的键盘后问题消失了。 (我偶尔需要英镑。)

Apple 记录的报告。

关于bash - 在 macOS Mojave 上运行 osascript -e [command] 时出现奇怪的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53603246/

相关文章:

android - adb 无法在 bash 中使用变量

bash - 将两个文件粘贴到第一个文件

javascript - 如何为 npm 脚本提供默认参数值?

cocoa - 在 Keynote 演示上方显示 Cocoa 窗口

android - "Waiting for target device to come online"Mac 安卓工作室

objective-c - 为什么 AppleScript "tell"命令在后台运行 GUI 应用程序的非 GUI 实例?

bash - 连接本地文件和远程文件

macos - NSDragOperation通用含义

windows - Windows 上的 AppleScript

shell - applescript/shell 中的单引号转义