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

MacBook MH

macrumors member
Original poster
Mar 7, 2009
76
0
How do I keep the dialog box open after clicking a button?
Situation:
set question to display dialog "What do you want to do?" buttons {"Quit", "Download", "Start >>"} default button 2
set answer to button returned of question
if answer is equal to "Quit" then
tell application "System Events" to quit
end if
if answer is equal to "Start >>" then
set asker to display dialog "Which Machine?" buttons {"1st Machine", "Other machine(s)"} default button 1

if answer is equal to "Download" then
tell application "Safari"
activate
do JavaScript "window.open('http://www.downloadthefile.com')" in document 1
end tell
end if
how do i get the first dialog to stay open when i click the download button
 
how should I do it? the loop should end also when the start >> button is clicked....
please could you paste the scriptlet here?
thanks
 
the /question/ is a variable... couldnt i just display it once more after clicking download.... an if so how?
 
how should I do it? the loop should end also when the start >> button is clicked....
please could you paste the scriptlet here?
thanks

How's this?

Code:
repeat
set question to display dialog "What do you want to do?" buttons {"Quit", "Download", "Start >>"} default button 2
set answer to button returned of question

if answer is equal to "Start >>" then
set asker to display dialog "Which Machine?" buttons {"1st Machine", "Other machine(s)"} default button 1
exit repeat

else
if answer is equal to "Quit" then
tell application "System Events" to quit
display dialog "Quitting."
exit repeat
end if

else
if answer is equal to "Download" then
tell application "Safari"
activate
do JavaScript "window.open('http://www.downloadthefile.com')" in document 1
end tell
end if 

end if
end repeat
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.