[英]Add an icon to pop-up in Terminal
本質上,我想從終端向彈出警報提示添加圖標。 這是代碼:
osascript -e 'tell app "System Events" to text returned of (display dialog "Enter Text: " default answer "")'
舉一個例子,當系統提示您輸入密碼窗口時,該窗口中會出現一個“鎖定”圖標。 謝謝!
要將圖標添加到AppleScript對話框,可以使用:
with icon file "path:to:icon.icns"
其中path是位置和文件名(圖標可以是.png
等),因此您將得到以下結果:
osascript -e 'tell app "System Events" to text returned of (display dialog "Enter Text: " default answer "" with icon file "path:to:icon.icns")'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.