Answer:
for example, to password protect safari, copy this into applescript editor and change where it says --password--.
display dialog "Please enter password to access the Internet." default answer "" buttons {"enter"} default button 1
set theResult to text returned of the result
if theResult is "--password--" then
display dialog "Thank you" buttons {"Continue to Internet"} default button 1
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Window" of menu "File" of menu bar 1
end tell
end tell
else if theResult is not "--password--" then
beep 2
end if
end
end
hope it helps!