• The Forums are now open to new registrations, adverts are also being de-tuned.

OsX Dialog Boxes

Spinal

MB Enthusiast
Joined
Sep 14, 2004
Messages
4,806
Location
between Uxbridge and the Alps
Car
x254, G350, Duster, S320, Mach1, 900ss and a few more
As there is so much support for apple here, I thought I'd ask someone for help...

I want to create a popup/error message in OsX from terminal; kind of like dialog, Xdialog, zenity and cdialog do in ubuntu... problem is, the only command that remotely gets close (that I can find) is xmessage... but this looks NOTHING like an OsX error message... (it run on X11, not cocoa).

Any ideas?

M.
 
I was hoping there was/is a built in function, but that doesn't apear to be the case...

I'd prefer not to install software... I guess I'll use the horrid X11 one...

Just to provide backing, I'm enforcing quotas, but want to automatically "warn" users when they approach the quota. Soft-quotas would work, but it seems that OsX doesn't give you a warning that you went over the soft-quota! (at least, not until the end of the grace period)

M.
 
Try this:
# a dialog with a text message and some buttons
message="Hello World!"
button=`osascript << EOT
tell application "Terminal"
display dialog "$message" buttons {"Hello", "Goodbye"} default button "Hello" giving up after 15
set result to button returned of result
end tell
EOT`

Via AppleScript apparently. Stolen from here: Help in UNIX [Archive] - The macosxhints Forums
 
Thanks - I ended up using a fairly long-winded method; quite similar to the osascript example above... (only I packaged the script as an app and invoke that automatically whenever a user goes over 4gb)

M.
 
Glad you sorted it. :thumb:
 

Users who are viewing this thread

Back
Top Bottom