display dialog "Error, Could not open chosen application. Try again in a few moments" buttons {"Report", "Ignore"} with icon 0
set the choice to the button returned of the result
if the choice is "Report" then
display dialog "Reporting to apple" with icon 0
end if
set the choice to the button returned of the result
if the choice is "Ignore" then
display dialog "ERROR ERROR. Computer Breached by Harmful Entity" with icon 0
end if
这些对代码的细微调整应该可以达到您想要达到的效果。
在任何display dialog
或display alert
命令之前插入activate
命令将确保对话框或警报窗口不会丢失在您可能打开的任何其他窗口之后。它应该把他们带到前面
activate
set theChoice to button returned of ¬
(display dialog "Error, Could not open chosen application. Try again in a few moments" buttons ¬
{"Report", "Ignore"} with icon 0)
if theChoice is "Report" then
activate
display dialog "Reporting to apple" with icon 0
else
activate
display dialog "ERROR ERROR. Computer Breached by Harmful Entity" with icon 0
end if