1 shell 调用 applescript :
shell line
shell line
osascript <<EOF
AppleScript line
AppleScript line
EOF
shell line
shell line
注意:格式必须正确,即osascript <<EOF 和 EOF 必须是一行的开头。
如: shell 文件
#! /bin/sh
echo "AAA"
echo `pwd`
#osascript ./applescripta.scpt
exec osascript <<EOF
tell application "System Events"
display dialog "bal bal"
end tell
EOF
echo "CCC"
exit 0
2 applescript 调用 shell
在applescript 脚本中调用:“do shell script” 命令
set fileInfo to do shell script "cd ~; ls"
解决办法:
1 在执行的shell 脚本中,是否可以判断启动的方式
2 在启动的shell 脚本中,调用Applescript,Installer is scriptable application :不是
3 Installer 中的javascript 是否可以放在最后执行
关于Shell, perl, applescript 之间互相调用可以参考:
http://macdevcenter.com/pub/a/mac/2003/11/07/scripting_osx.html?page=1