Re: How to close-quit an osascript making a dialog box?
Re: How to close-quit an osascript making a dialog box?
- Subject: Re: How to close-quit an osascript making a dialog box?
- From: Axel Luttgens <email@hidden>
- Date: Tue, 31 Dec 2002 15:48:27 +0100
Jerry Krinock wrote:
>Hi,
>
>I would like Unix cron to display a dialog box. I have put the following
>command line in the crontab:
>
>osascript -e 'display dialog "Hello World"'
>
>Very cool. I get a dialog box "Hello World", a Cancel button and an OK
>button. I can move the dialog box, but nothing happens when I click the
>buttons. I cannot close the dialog box.
>
>The same thing happens if I execute the above command in Terminal,
except in
>addition the osascript process hangs. The box finally goes away if I
close
>the Terminal window or kill the process from another Terminal window.
>
>How do I make an osascript dialog close and quit?
>
>Thanks!
>
Seems to be a matter of user interaction: "display dialog" needs to be
executed within a context where a user interface exists (same problem as
when trying to make an AppleScript applet run as a faceless application).
So, assuming the Finder is always running, you could type following in
Terminal:
osascript -e 'tell app "Finder" to display dialog "Hey!"'
or, if you want to launch the process in the background:
osascript -e 'tell app "Finder" to display dialog "Hey!"' &
HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.