How do you make a password in an Applescript?

make an application ask for password applescript

  • I'm trying to write an AppleScript Code which makes Firefox ask me for a password when I open it. This is what I got, but somehow it doesn't work: on activate display dialog "Please enter your password" buttons {"Cancel", "Okay"} default answer "" default button 2 set x to text returned if x is "Password" then tell application "Firefox" activate reopen end tell else say "please try again" end if end activate I also need to know where to save the Script, when it is correct. Thanks a lot!

  • Answer:

    There was an error in the set x to text returned. It needs to know what dialog you're referring to. See below. on activate set passwordRequest to display dialog "Please enter your password" buttons {"Cancel", "Okay"} default answer "" default button 2 set x to text returned of passwordRequest if x is "Password" then tell application "Firefox" activate reopen end tell else say "please try again" end if end activate

Collin Alpert at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.