When a Application has reached a status, a popup should appear and after pressing “OK” (only the one choice)
the Application should quit and then restart
if Q contains "one" then
try
tell current application
display dialog "National Roaming is not allowed - please refresh the Programm"
set the requested_status to the button returned of the result
end tell
on pressed button "OK" --is this correct?
quit theApplication -- is this correct?
restart theApplication -- is this correct?
end try
end if
If you have only one button, there is no need to retrieve the answer.
The try block is only necessary, if you want to trap an error or avoid any error message
actually this is sufficient:
if Q contains "one" then
tell current application to display dialog "National Roaming is not allowed - please refresh the Programm" buttons {"OK"} default button 1
quit theApplication
delay 1
launch theApplication
end if
It may be that you need run or activate instead of launch. I haven’t checked recently, but the difference between these commands used to be:
launch: load the application into memory. run: load the application into memory and run it through its normal startup routine “ eg. opening a default document, etc. activate: load the application into memory, bring it to the front, and run it through its normal startup routine. Alternatively, if it’s already launched or running, just bring it to the front.