
This script presents a text entry dialog where the text entered by the user is encrypted as bullets so that nosy people, for instance, cannot see what is being entered on your screen.
Seriously, though, the main purpose of this type of dialog is as a security measure to restrict access to critical files.set thePass to "pass90805"
--Here, depending upon the application, you could have 'thePass' set to the value stored in a global field, In FileMaker it would be something like 'set thePass to data of cell "passwordStorage"'considering case
repeat with x from 1 to 3
display dialog ("Enter the password for access to this file:") default answer "" with icon stop with hidden answer
if the text returned of the result is thePass then
exit repeat
end if
if x is 3 then return "You have attempted to access this file too many times. Your access is denied. Please try again."
end repeat
end considering
The considering case block tells AppleScript to require that the text entered match the particular case of the pre-determined password (upper or lower).
By the way, the part that gives the bullets instead of the actual text entered is 'with hidden answer'
The repeat block allows the user 3 attempts at entering the password for access and after that, terminates the script.
Contact me if you have any questions or comments at: hyperscripter@gmail.com or http://twitter.com/hyperscripter




