I have an applescript program that auto opens whenever I wake my computer.

I would like it to be unclosable until I input a password into it.

Tried searching but found absolutely no sources that could further my knowledge of unclosable applescript windows.

Oh and btw i'm pretty new to applescript, if the answer is simple then don't hate:)


  • applescript that auto-opens what? – Tetsujin Jan 12 '15 at 10:02
  • I think you misinterpreted, I would like to create a (applescript) program that does not close until a question is answered. As for the program, it opens when my computer wakes. – Pringles Jan 13 '15 at 2:12
  • 1
    I see what you mean, but 'does not close' is is a long way from being 'uncloseable' which would not be possible with Applescript. It could always be force quit, or merely backgrounded. – Tetsujin Jan 13 '15 at 6:27
  • Ok, I would like to make it as hard as possible to close that Applescript allows, any chance I could do that? – Pringles Jan 15 '15 at 2:11
  • Not really. It's just another app. – Tetsujin Jan 15 '15 at 7:39

I guess you are trying to make a password protect with AppleScript. My advice: just use the one Apple gives you. Using AppleScript for this is annoying and tedious. But hey, your choice. Here is a AppleScript code that only closes when you type "password" but of course you can still use any other application while the dialog is open. All it does is stay in front and acts annoying. Here's the code:

  tell application "System Events"
    set txt to text returned of (display dialog "Your text" default answer "" buttons {"OK"} default button 1)
    if txt is equal to "password" then 
      exit repeat 
    end if 
  end tell 
end repeat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.