mac下shell弹出下拉选择框

#!/bin/bash
osascript -e '
tell application "System Events"
    activate
    set userChoice to choose from list {"Option 1", "Option 2", "Option 3"} with title "Select an Option" with prompt "Please select:"
    return userChoice
end tell'

read -r selectedOption < <(osascript -e '...') # 将AppleScript返回的结果存入bash变量
echo "You chose: $selectedOption"

mac下shell弹出下拉选择框-20240302035305773.webp