I deleted the beginning of a line.
--{SCRIPT]
tell application "System Events"
set processusVisibles to name of application processes whose visible is true
end tell
# Get four localized strings
set p2pane to ((path to library folder from system domain as text) & "PreferencePanes:StartupDisk.prefPane") as alias
set btn1 to localized string "CANCEL" in bundle p2pane
set btn2 to localized string "RESTART" in bundle p2pane
set btn3 to localized string "SHUTDOWN" in bundle p2pane
set prompt to localized string "RESTART?" in bundle p2pane
repeat with unProcessus in processusVisibles
set unProcessus to unProcessus as text
if unProcessus is not "Finder" then
tell application "System Events" to get bundle identifier of process unProcessus
tell application id result to quit
end if
end repeat
set queFaire to display dialog prompt buttons {btn1, btn2, btn3} default button 3
if button returned of queFaire is btn3 then
tell application "System Events" to shut down
else if button returned of queFaire is btn2 then
tell application "System Events" to restart
end if
--[/SCRIPT]