【发布时间】:2013-06-21 19:19:40
【问题描述】:
我有一个使用osascript 调用的shell 脚本,而osascript 调用一个shell 脚本并传入一个我在原始shell 脚本中设置的变量。我不知道如何将该变量从 applescript 传递到 shell 脚本。
如何将变量从 shell 脚本传递到 applescript 到 shell 脚本...?
如果我不明白,请告诉我。
i=0
for line in $(system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'); do
UDID=${line}
echo $UDID
#i=$(($i+1))
sleep 1
osascript -e 'tell application "Terminal" to activate' \
-e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' \
-e 'tell application "Terminal" to do script "cd '$current_dir'" in selected tab of the front window' \
-e 'tell application "Terminal" to do script "./script.sh ip_address '${#UDID}' &" in selected tab of the front window'
done
【问题讨论】:
标签: bash shell applescript osascript