tell application "Finder"
tell application "Finder"
display dialog "This is the Display Dialog command.
Isn't it cool?" with title {"Title"} buttons {"Yes", "No", "Cancel"} cancel button 3 default button 3 default answer "" giving up after 10
end tell
if result = {gave up:true} then display dialog "Continue?"
end tell
Hi! This will likely be very simple. I’m trying to get this script to display another dialog box upon the result returned for the give up parameter. I thought nested tell block would work but apparently the information is not passing through to the next block. Suggestions?
You have to capture the gave up parameter of the returned record
set {gave up:gaveUp} to display dialog "This is the Display Dialog command.
Isn't it cool?" with title {"Title"} buttons {"Yes", "No", "Cancel"} cancel button 3 default button 3 default answer "" giving up after 10
if gaveUp then display dialog "Continue?"
tell application "Finder"
try
set myAnswer to gave up of (display dialog "This is the Display Dialog command." & return & return ¬
& "Isn't it cool?" with title {"Title"} buttons {"Yes", "No", "Cancel"} cancel button 3 default button 3 default answer "" giving up after 5)
on error
set myAnswer to true
end try
if myAnswer = true then display dialog "Continue?"
end tell
The try block will test for the user choosing “Cancel” button.
if the dialog gives up on it’s own, an error isn’t triggered, so the result gets put in a variable “myAnswer”