Re: osascript and dialogs
Re: osascript and dialogs
- Subject: Re: osascript and dialogs
- From: matt neuburg <email@hidden>
- Date: Tue, 10 Jun 2003 16:10:33 -0700
On 6/10/03 at roughly 6:02 PM, thus spake Joshua See
<email@hidden>:
>
On Tuesday, June 10, 2003, at 11:27 AM, Christopher Nebel wrote:
>
>
> On Tuesday, June 10, 2003, at 08:01 AM, matt neuburg wrote:
>
>
>
>> The following puts the computer into a bizarre state:
>
>>
>
>> Yes, Matt? cat > textfile
>
>> display dialog "Hello, world!"
>
>> [^D]
>
>> Yes, Matt? osacompile -o compiledfile textfile
>
>> Yes, Matt? osascript compiledfile
>
>>
>
>> The dialog appears, but refuses to let me click on it. Appending "&"
>
>> doesn't help - in fact, it makes it worse, since there's now
>
>> absolutely no
>
>> way to get rid of the dialog short of killing osascript. What's the
>
>> problem here? Thx - m.
>
>
>
> It's a bug. In fact, it's not supposed to work at all -- osascript
>
> should fail with a "no interaction allowed" error. (It's got no UI.)
>
> Tell some other application (e.g., Finder) to display the dialog.
>
Since osascript doesn't have a GUI, hand the display dialog command off
>
to something that does
(1) Obviously.
(2) You're just repeating what Chris said ("tell some other application to
display the dialog").
>
The reasoning behind osascript is a bit of mystery to me. It has the
>
interactivity prevention, which means it isn't intended for
>
user-centric scripts or as a substitute for GUI script editors.
>
However, it won't take arguments even though the syntax "on run
>
({arglist})" in AS offers an obvious means of supporting them, and it
>
chokes on shebangs, which means it isn't meant for Mac-friendly shell
>
scripting or automation, either. Why does this program exist?
Uh, so you can call AppleScript from a Unix context. Do you really need an
example? I've got some great ones, such as a Ruby word-histogram script
that graphs its results in Excel... m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.