Check the "switch" syntax: it's "break" not "exit switch"
But your problem is that aborting the closeStack messages doesn't stop the quitting process.
You are looking for the "shutdownRequest" message rather.
on shutdownRequest -- confirm with the user:
answer question "Are you sure you want to quit?" with "Yes" or "No"
if it is "Yes" then pass shutdownRequest -- allow to quit
end shutdownRequest
answer "Are you sure you want to quit?" with "No" or "YES"
switch it
case "YES"
hide this stack
quit
BREAK
case "NO"
BREAK
end switch
end closeStack
But the stack quit always....i don't know....i've tryed your code for the showtdown...but don't work... iwant that the code work when i push the close window button.......
ok....
if you have any other ideas......o perhaphs i have made another mistake to write the code.......
As I said previously, trapping the closeStack Message doesn't change anything. And even if it did, it wouldn't work in the case of your script, since you don't pass it on in the "No" case. By the way, it's useless to have a case in a switch structure with no statements. Speaking of scripts, could you please enclose your scripts in "
" tags ? It's the little button at the top of the field used to write your post.
If you want a user confirmation when using the close window button and not only when the application quits, use the closeStackRequest message.
[code]
on closeStackRequest
answer "Are you sure?" with "No" or "Yes"
if it is "Yes" then pass closeStackRequest
end closeStackRequest
Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!! Thank you x-apple!!!!!
Thank you very much!!! this script work so fine!!!It's the best for my application.....
i'm so sorry for the script without the code...[...code]-[.../code], because i didn't remember me this trick......