my startApp()
on startApp()
set _primascelta to (choose from list {"Vedi calendario", "Classifica squadre", "Classifica marcatori"} with title "Serie A TIM")
if _primascelta is "Vedi calendario" then
open location "http://www.corrieredellosport.it/live/SerieA/calendario.shtml"
set _secondascelta to (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "No" then
my startApp()
end if
if _primascelta is "Classifica" then
open location "http://www.corrieredellosport.it/live/SerieA/classifica.shtml"
set _secondascelta to (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "No" then
my startApp()
end if
if _primascelta is "Classifica marcatori" then
open location "http://www.corrieredellosport.it/live/SerieA/statistiche/giocatori/gol.shtml"
set _secondascelta to (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "No" then
my startApp()
end if
end startApp
my startApp()
on startApp()
try
set _primascelta to (display dialog "Scegli un'opzione:" buttons {"Vedi calendario", "Classifica", "Annulla"} with title "Serie A TIM")
if _primascelta is "Vedi calendario" then
open location "http://www.corrieredellosport.it/live/SerieA/calendario.shtml"
set _secondascelta to (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "No" then
my startApp()
end if
end if
if _primascelta is "Classifica" then
open location "http://www.corrieredellosport.it/live/SerieA/classifica.shtml"
set _secondascelta to (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "No" then
my startApp()
end if
end if
-- added the error trap
on error _errMsg
display dialog _errMsg
end try
end startApp
choose from list returns boolean false or a list of items, so you have to flatten the list display dialog returns a record. You need the button returned key
Instead of calling the handler again and again I wrote a repeat loop
startApp()
on startApp()
repeat
set _primascelta to (choose from list {"Vedi calendario", "Classifica squadre", "Classifica marcatori"} with title "Serie A TIM")
if _primascelta is false then return
set _primascelta to item 1 of _primascelta
if _primascelta is "Vedi calendario" then
open location "http://www.corrieredellosport.it/live/SerieA/calendario.shtml"
else if _primascelta is "Classifica squadre" then
open location "http://www.corrieredellosport.it/live/SerieA/classifica.shtml"
else
open location "http://www.corrieredellosport.it/live/SerieA/statistiche/giocatori/gol.shtml"
end if
set _secondascelta to button returned of (display dialog "Terminare il programma?" buttons {"No", "Annulla"} with title "Serie A TIM" default button 1)
if _secondascelta is "Annulla" then return
end repeat
end startApp
Wow. the reason I ask this is that Stefan sounds French, but come to think of it, think I’ve asked you this before. Strange name for German. It’s amazing to me that I can be writing to people from all over the world. That’s part of what males this all fun. Meeting people from all over the world.
Edited: you know that living on a small island is very different.