Re: Running AppleScript code from the Terminal?
Re: Running AppleScript code from the Terminal?
- Subject: Re: Running AppleScript code from the Terminal?
- From: Philip Aker <email@hidden>
- Date: Fri, 31 Jan 2003 13:13:14 -0800
On Thursday, January 30, 2003, at 03:16 PM, Alexander Sauer-Budge
wrote:
which works fine, but when I tried something like
/usr/libexec/locate.updatedb; osascript -e 'display dialog "Update
complete!" buttons {"Ok"}'
I couldn't bring the dialog to the front and click on the button! I
had to kill it from the terminal!
I think we tamed this pesky item a few months ago. You'll want to send
the command to the current application or maybe the frontmost
application. For example:
osascript -e 'tell application "Terminal" to display dialog "Update
complete!"'
works when one is using Terminal. Don't even have to use the mouse. But
if you tell System Events to do the same job while in Terminal, then
you will have to activate it first and then tell it to do something
line by line:
osascript -e 'tell application "System Events" to activate' -e 'tell
application "System Events" to display dialog "Hi"'
If you need to have dialog facilities from shell scripts, you'll get
much quicker dialog opening if you compile a tool and use the basic
alerts available in the Carbon APIs. They'll snap up very quickly.
HTH,
Philip Aker
http://www.aker.ca
_______________________________________________
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.