在 MacOS 上获取应用的捆绑标识符(Bundle identifier)
在 MacOS 上,使用<code>osascript</code>命令可以执行苹果脚本和其他OSA语言脚本,通过<code>-e</code>选项可以直接在命令行中输入并执行脚本代码。例如,用<code>osascript -e 'id of app "Obsidian"' </code>可以获取应用程序“Obsidian”的bundle identifier。Bundle identifier是一个唯一的字符串,通常格式为<code>com.companyname.appname</code>。如果应用程序已安装并运行,命令将返回其bundle identifier,否则会显示错误信息。