Übergeben Sie die Variable vom Shell-Skript an das Apple-Skript
Ich habe ein Shell-Skript, das ich benenne und das verwendetosascript
, und dasosascript
ruft ein Shell-Skript auf und übergibt eine Variable, die ich im ursprünglichen Shell-Skript festgelegt habe. Ich weiß nicht, wie ich diese Variable vom Applescript an das Shell-Script übergeben soll.
Wie kann ich eine Variable von Shell-Skript zu Apple-Skript zu Shell-Skript übergeben ...?
Lassen Sie mich wissen, wenn ich keinen Sinn habe.
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