Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

I'm a Mac

macrumors 6502
Original poster
Nov 5, 2007
436
0
I am an applescripts newbie, and I want to create a dialog box with different answers for different choices. Here is my code:

display dialog "Something" buttons {"Click Here!", "Or here"} default button "Click Here!"
display dialog "Shouldn't you be doing something?" buttons {"Yes", "No"}


How do I make it so that it will display a different dialog depending on whether you click yes or no?
 

karenflower

macrumors 6502a
Dec 7, 2007
530
0
Hi, here's an example of how to do that:

Code:
set question to display dialog "Shouldn't you be doing something?" buttons {"Yes", "No"} default button 2
set answer to button returned of question

if answer is equal to "Yes" then
	display dialog "Do it, then!" buttons {"No thanks", "Ok"} default button 2
end if

if answer is equal to "No" then
	display dialog "Good for you." buttons {"I know", "Really?"} default button 2
end if

Hope you can adapt it to your needs! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.