Thanks for your answer, but that's not what I'm looking for.
Perhaps I should explain what I need more thoroughly.
I'm running an AppleScript, and while it is running someone might shutdown or restart the Mac.
If this happens, my applecript won't let the Mac to Restart, nor to ShutDown. Therefore, unless the user kills the applescript process before he or she wants to Restart or shutdown, that won't occur.
I thought, I might add an
if (something happens) then
Allow to shutdown or Restart
end if
but I'm still looking for that "something happens"
So let's get back to my original question. Is there a solution to this problem?
Thanks