I want to be able to have my program display an alert, notice, whatever that displays my custom text. How is this done? Also, is it possible to make one with several buttons that sets a variable?
Active1 year, 6 months ago
Nov 05, 2018 For example, you can copy and paste the text, search it online, fix spelling issues, open a dictionary, highlight it or change its formatting in apps like Pages, Evernote, or Scrivener, display helpful text statistics, access an online translator, have your Mac.
Similar to batch's: JShoeJShoe
echo msgbox'<a.vbs&a.vbs
1,25577 gold badges2626 silver badges5050 bronze badges
7 Answers
Use
osascript . For example:
Replacing “Finder” with whatever app you desire. Note if that app is backgrounded, the dialog will appear in the background too. To always show in the foreground, use “System Events” as the app:
Read more on Mac OS X Hints.
Andrew Marshall
82.4k1717 gold badges189189 silver badges197197 bronze badges
AnneAnne
24.6k99 gold badges5757 silver badges6868 bronze badges
If you're using any Mac OS X version which has Notification Center, you can use the terminal-notifier gem. First install it (you may need
sudo ):
and then simply:
See also this OS X Daily post.
Cœur
22.1k1010 gold badges127127 silver badges180180 bronze badges
Enrico CarlessoEnrico Carlesso
5,32722 gold badges3030 silver badges4040 bronze badges
Use this command to trigger the notification center notification from the terminal.
Pradeep VairamaniPradeep Vairamani
2,11422 gold badges2424 silver badges4848 bronze badges
This would restore focus to the previous application and exit the script if the answer was empty.
![]()
If you told System Events to display the dialog, there would be a small delay if it wasn't running before.
For documentation about display dialog, open the dictionary of Standard Additions in AppleScript Editor or see the AppleScript Language Guide.
LriLri
Easy Program Or App For Soccer Video Editing
20.8k77 gold badges6969 silver badges7070 bronze badges
And my 15 cent. A one liner for the mac terminal etc just set the MIN= to whatever and a message
A bonus example for inspiration to combine more commands; this will put a mac put to standby sleep upon the message too :) the sudo login is needed then, a multiplication as the 60*2 for two hours goes aswell
K. Kilian LindbergK. Kilian Lindberg
Boundary Fencing Display Program Or App For Macbook
A simular question and answer is available at:https://superuser.com/questions/246353/how-to-make-the-terminal-do-a-pop-up-alert-in-osx
Community♦
MarkMark
I made a script to solve this which is here. You don't need any extra software for this.Installation:
brew install akashaggarwal7/tools/tsay Usage: sleep 5; tsay
Feel free to contribute!
Boundary Fencing Display Program Or App For Mac
Akash AgarwalAkash Agarwal
Not the answer you're looking for? Browse other questions tagged macospopupterminalapplescriptalert or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2020
Categories |