mac下shell弹出下拉选择框

2024-05-11 0 1
手机查看
#!/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

What do you think?
  • 点赞
    0
    点赞
  • 踩一下
    0
    踩一下
  • 酷毙了
    0
    酷毙了
  • 不屑
    0
    不屑
  • 尴尬
    0
    尴尬
  • 无聊
    0
    无聊
Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.5.6