我有一个shell脚本,用于检查文件夹是否具有一定数量的文件并向用户显示错误消息。我使用applescript来显示错误消息。有没有办法将shell脚本的变量传递给AppleScript?如何将变量从shell脚本传递给applescript
以下是我有:
declare -i count=5;
osascript -e 'tell app "Xcode" to display dialog "Counted $count items." buttons {"Continue"}'
我想要的输出为Counted 5 items.
,但它只是出来作为Counted $count items.
我如何传递一个shell脚本变量的AppleScript的?
干杯。我使用第二种方法,因为我没有空格,这是最容易实现的。 –
如果var包含空格,我发现这个工作:'osascript -e'显示对话框“string1”“$ var”'string2“'' – jrodatus