如何使Applescript运行终端应用程序?

如何使Applescript运行终端应用程序?,applescript,Applescript,我是堆栈溢出新手,我有一个关于我正在制作的Applescript项目的问题 display dialog "Android Debugging Bridge GUI Please select the action you want to do. Ver 1.0" buttons {"Connected Devices", "", "Quit"} set the button_pressed to the button returned of the result if the button_p

我是堆栈溢出新手,我有一个关于我正在制作的Applescript项目的问题

display dialog "Android Debugging Bridge GUI
Please select the action you want to do.
Ver 1.0" buttons {"Connected Devices", "", "Quit"}
set the button_pressed to the button returned of the result
if the button_pressed is "Connected Devices" then

tell application "Terminal"
    if (count of windows) is not 0 then
        do script "~/Desktop/ADB-GUI/ADB-GUI.app/Contents/Resources/minerboyadb/" in window 1
        do shell script "adb-devices.sh"
    end if
end tell

else if the button_pressed is "" then
-- action for 2nd button goes here
else
display dialog "Thanks for using MinerBoy004's ADB GUI!" buttons {"Quit"}
if the button_pressed is "Quit" then
    quit
end if
end if

每当我尝试运行此操作时,终端都会收到一个错误,显示为./adb not found。我确保它进入目录,但它不会运行。/adb。如何修复此问题,使应用程序正常工作?由于仍在WIP中,某些代码为空。第一个shell脚本是否为第二个shell脚本设置了环境?如果是这样,您需要在同一个shell中执行它们,而不是在单独的、断开连接的shell中执行它们。我的意思是,您可能需要在一个shell中完成shell脚本设置和其他操作。&&表示只有在第一件事情成功的情况下才做第二件事情。谢谢您的帮助!:D