[英]Repeat Pop-Up Alert If Left Empty?
我使用以下代碼創建了一個彈出警報:
text=$(osascript -e 'tell app "System Events" to text returned of (display dialog "Pop-Up Text" default answer "")')
但是,如果答案留空,我希望此提示再次運行。 我嘗試了以下方法:
if [$text == ""]; then text=$(osascript -e 'tell app "System Events" to text returned of (display dialog "Pop-Up Text" default answer "")'); fi
但是,如果彈出窗口被取消或在第二次不再出現時保持空白,則此方法有效。
如果答案留空或被取消,我只需要彈出提示以繼續顯示。
這是一個Bash腳本嗎? 如果是這樣,請使用while循環顯示提示,而text
為""
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.