Re: Dialog Director - Quit action
Re: Dialog Director - Quit action
- Subject: Re: Dialog Director - Quit action
- From: Richard Morton <email@hidden>
- Date: Sun, 27 Oct 2002 01:14:44 +1000
On Saturday, October 26, 2002, at 10:00 AM, Duncan Cowan wrote:
I've been playing with Dialog director in OS 9.2.1 - to create an
"output"
preferences dialogue.
However I was having trouble getting the script to quit if the cancel
button
was returned.
Reading the dictionary, I noticed that the "push button" class has an
"action" property that is triggered when the button is pressed.
Excellent! or so I thought....
Being a simple fellow I assigned the term "Quit" to my cancel button and
compiled.
I've never used button actions, but they're documented in the user
guide. A quick look suggests that they're for calling handlers or
drawing another dialog. You could call a 'doQuit' handler if you wanted
to, but it's not the standard way of doing it.
Suddenly Script Editor (1.6) was asking if I wanted to save my script
before
quitting!
This can't be the expected result . . . can it? =)
Oh . . Smile does the same thing . . .
'quit' will generally end up being directed at whoever is running the
script. Compiled scripts are best terminated with a user cancel error:
number -128
Has anyone who uses DD have any ideas on what I'm doing incorrectly?
I've managed to solve the problem of quitting the script in another way
so
it's merely a point of interest now anyway.
DD auto dialogs return a list when dismissed. If the 'Cancel' button
is, say, item 2 of the dialog, it will be 'true' in the resulting list.
Test for this & cancel if so:
set dResult to dd auto dialog {your_dialog_record}
if item 2 of dResult then
error number -128
else
-- whatever
end
Live DD dialogs are a bit more complex & can be cancelled in lots of
ways. If you have DD you should have all the examples, which are
excellent. Feel free to post some code if you're still unclear. Also,
have a look at the FooDoo Lounge if you want to see some stuff I've done
with DD:
http://home.netc.net.au/~sunreal/FooDooLounge/index.html
Cheers,
Dia Lectric
_______________________________________________
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.